in john hunt's mock exam
Q.7
what will be the result of compiling the following code:
public class
Test {
public static void main (
String args []) {
int age;
age = age + 1;
System.out.println("The age is " + age);
}
}
A.Compiles and runs with no output
B.Compiles and runs printing out The age is 1
C.Compiles but generates a runtime error
D.Does not compile
E.Compiles but generates a compile time error
the answer is D
i'm wondering why not E, coz i tested it and
it did compile but generate an error saying
"variable age might not have been initialized".
what's the difference between "does not compile" and
"compile time error"?
thanks