Question 12 / 297:  What is the expected output?
public class LoopTest {

public static void goLoop(int a) {

start: for (int i = 1; i < 2; i++) {

for (int j = 1; j < 2; j++) {

if (a < 5) {

break;

}

System.out.print(i + j);

}

if (a > 5) {

break start;

}

}

}

public static void main(String args[]) {

LoopTest.goLoop(15);

}

}

A  2
B  No output is produced
C  Compile Error
D  Runtime exception is thrown
E  24
<< First < Previous Next > Last >>
Exam Home Page
Ask
Yasser Ibrahim
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>