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

 
 

SCJP Module-5 Question-10
Posted on: July 12, 2010 at 12:00 AM
The program given below tests your understanding and logic of for loop in Java and for preparation for SCJP examination.

Given a sample code:

1    public class Test{
2    public static void main(String args[]) throws Exception{
3    for (int i = 5;i < 8;i++){
4    for (int j = 5;j < 8;){
5    System.out.print(i);
6    System.out.print(j+" ");
7    break;
}}
}}

What will be the result of above code ?

(1) Compilation fails at line number 4.
(2) 55 65 75
(3) 5 6 6
(4) 55 66 77

Answer:

(2)

Related Tags for SCJP Module-5 Question-10:


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.