标签:print 目的 demo thread array int nbsp inter 部分
①编译时错误
②运行时错误
①软件编译错误信息包含四部分:
Exception in thread "main" java.lang.ClassCastException: interfaceDemo.Cat cannot be cast to interfaceDemo.Animal
at interfaceDemo.TestDog.main(TestDog.java:42)
①在哪个线程中? ②异常类型 ③错误信息 ④在源代码中的具体位置(行数)
异常:
ArrayIndexOutOfBounds
NullPointerException
ClassCastException
目的:①测试程序是否进入某个方法体中执行,可以在方法体中添加如下代码:
System.out.println(111);
②测试某个变量是否改变,可以输出该变量:
System.out.println(x);
标签:print 目的 demo thread array int nbsp inter 部分
原文地址:http://www.cnblogs.com/vcyy/p/7892689.html