每天开心一点

Java异常处理——Exception和RuntimeException

2019-11-30 18:23:00    六月    855    来源: https://blog.csdn.net/qq_37084904/article/details/85550220

Exception是检查型异常,在程序中必须使用try...catch进行处理;

RuntimeException是非检查型异常,例如NumberFormatException,可以不使用try...catch进行处理,

但是如果产生异常,则异常将由JVM进行处理;