Home Tutorial Java Scjp Part5 SCJP Module-5 Question-9

 
 

SCJP Module-5 Question-9
Posted on: July 12, 2010 at 12:00 AM
The Program given below will test your understanding of loop and its flow in Java program. This example is also very useful for preparation of SCJP exam.

Given a sample code:

public class Test {
public static void main(String args[]) {
int i = 9;
while (i++ <= 12) {
i++;
}
System.out.print(i);
}
}

What will be the result of above code ?

(1) 10
(2) 14
(3) 13
(4) 11

Answer:

(2)

Related Tags for SCJP Module-5 Question-9:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.