A

Admin • 831.35K 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.
  • Correct Answer - Option(A)
  • Views: 25
  • Filed under category Java
  • Hashtags:

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.

Be the first to start discuss.