bsd is right.the answe is D.sorry for the mistake i made.but what's your mean about "does not compile"?isn't the scaning of the code a behaviour or part of of compile
class a{
public static void main(String[] args){
int a;
a=a+1;
}
}
question:what will happen when compile this code?
.
.
.
D does not compile
E complile but throw a compile time error
the answer is E.can sb tell me what the difference between choise D and E
I mean the compiler exit before it create a class file.
and the prompt is as following:
-----------
C:\src>javac testCompile.java
testCompile.java:4: 变量 a 可能还未被初始化
a=a+1;
^
1 个错误