首页 > 代码库 > 最近遇到的异常与错误总结

最近遇到的异常与错误总结

异常
NumberFormatException  数字格式化异常
ArithmeticException 算术异常
ArrayIndexOutOfBoundsException  数组超出绑定异常:没有输入参数,或输入的参数不够
NullPointerException 空指针异常:使用了未实例化的对象
NoSuchMethodError:main  找不到主方法
ClassCastExeption:A 类转换异常
IllegalThreadStateException:非法的线程状态异常
IOException: IO流异常


错误
integer number too large
name has private access in Person 无法访问封装属性
call to this must be first statement in constructor  错误的调用,只能放在构造方法的首行
recursive constructor invocation 递归调用了构造方法
non-static variable name cannot be referenced from a static context  不能调用非static属性
non-static method fun() cannot be referenced from a static context 不能调用非static方法
Singleton() has private access in Singleton 无法实例化
print() in Student cannot override print() int Person; attempting to assign weaker access privileges; was public 覆写父类中的方法,便缩小了权限,错误
cannot inherit from final A
print() in B cannot override print() in A; overridden method is final
cannot assign a value to final variable INFO
OutOfMemoryError:

最近遇到的异常与错误总结