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
1090 days 2 hours ago

qekjrhgiehgvjef,dakmfnvkjdaf

Diva
By: Diva
1057 days 19 hours 25 minutes ago

good questions...

barca_alex
By: barca_alex
1018 days 3 hours 10 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
900 days 21 hours 8 minutes ago

the way how you wrote the question is not sufficient

Vivek
By: Vivek
847 days 4 hours 4 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
688 days 18 hours 10 minutes ago

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

Vivek
By: Megha Goyal
197 days 11 hours 9 minutes ago

compilation is considered TRUE.... so the ans is 1. True

Want to learn?

Sign up and browse through relevant courses.

or fill this simple form
Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as shown 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 | 1302 Attempts

C++ Multiple Choice
10 Questions | 2104 Attempts

Connect