Tyl*_*ton 3 java compiler-construction variables scope
我正在阅读Java,我正在摸索为什么System.out.println("a: " + a);不会产生编译错误.在哪里a初始化?
public class localVariableEx {
public static int a;
public static void main(String[] args) {
int b;
System.out.println("a: " + a);
System.out.println("b: " + b); //Compilation error
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
95 次 |
| 最近记录: |