Java Test

What is the output of following piece of code ?

int x = 2;

switch (x) {

case 1:System.out.println(“1?);

case 2:

case 3:System.out.println(“3?);

case 4:

case 5:System.out.println(“5?);

}


Stateful Session beans contain


A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector

new vector(5,10)


A method is defined in a class as :

void processUser(int i) { }

If this method is overriden in a sub class,_


What is the output of following block of program ?

boolean var = false;

if(var = true) {

System.out.println(“TRUE”);

} else {

System.out.println(“FALSE”);

}


Which of the following is correct syntax for an Abstract class ?


ejbCreate() method of CMP bean returns


In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?


A class can be converted to a thread by implementing the interface ___


Which of the following is correct syntax for an Abstract class ?































Description:

This test is created with a view to test your skills in Java. Questions are mainly from CORE JAVA, JSP, SERVLETS, EJB and few DATABASE related ones.
Best of luck!

Comments
bobby
By: bobby
702 days 22 hours 30 minutes ago

qekjrhgiehgvjef,dakmfnvkjdaf

Diva
By: Diva
670 days 15 hours 54 minutes ago

good questions...

barca_alex
By: barca_alex
630 days 23 hours 40 minutes ago

Why is b the right answer for question 1?
At question 5 at the if statement the program will give a compilation error because "var = true" is an asignment, not a comparation?

Majdi Mohammed Ali
By: Majdi Mohammed Ali
513 days 17 hours 38 minutes ago

the way how you wrote the question is not sufficient

Vivek
By: Vivek
460 days 34 minutes ago

In Qn no. 5, the comparison operator == should be used instead of =. otherwise, it is a compile time error.

Vivek
By: Lukas Opavsky
301 days 14 hours 39 minutes ago

No Vivek, it compiles just fine, try it out next time before you moan....

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Roshan Kumar
Learning With Fun
8 Followers
Tests: 3

Your Facebook Friends on WizIQ

More Tests By Author

Mathematical Reasoning
8 Questions | 759 Attempts

C++ Multiple Choice
10 Questions | 1583 Attempts

Explore Similar Courses

Develop Android Apps with Java

Price:$300
$40

SAVE 86%

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect