Home / Programming MCQs / JAVA MCQs / Question

M

Mr. Dubey • 51.43K Points
Coach

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.

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.