Q.

What is the output of the following program?
class Example {
public static void main(String args[]) {
int j;
do {
j++;
} while (j < 0);
System.out.println(j);
}
}

A. The program does not compile as j is not initialized.
B. The program compiles but does not run.
C. The program compiles and runs but does not print anything.
D. The program prints 0.
Answer» A. The program does not compile as j is not initialized.
970
0
Do you find this helpful?
12

View all MCQs in

Java Programming

Discussion

No comments yet

Related MCQs