error和exception有什么区别:
error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。
exception 表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况。
Runtime Exception常见错误:
ArithmeticException(四则运算错误)
ArrayStoreException(数组存储错误,例如将String类型存储在int[]中)
BufferOverflowException(缓冲上溢异常,即:计算结果超过最大存储值)
BufferUnderflowException(缓存下溢异常,即:计算结果低于最小存储值)
ClassCastException(类转换异常)
IndexOutOfBoundsException(数组越界异常)
NullPointerException(空指针异常)