奇葩总结

1、    public static void main(String[] args) {

            int a;

    }运行会报错吗?

答:会,Testcase: com.test.TestContainer: Caused an ERROR

No runnable methods

java.lang.Exception: No runnable methods

2、    public static void main(String[] args) {

            int a;

            System.out.println(""+a);

    }运行会报错吗?

答:会,D:\Bovin\workspace\JiLuError\test\com\test\TestContainer.java:15: 可能尚未初始化变量 a

            System.out.println(""+a);

1 错误

3、

猜你喜欢

转载自lbovinl.iteye.com/blog/2173026