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.
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
(2)