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);
}
}
class Example {
public static void main(String args[]) {
int j;
do {
j++;
} while (j < 0);
System.out.println(j);
}
}
β
Correct Answer: (A)
The program does not compile as j is not initialized.