码迷,mamicode.com
首页 > 编程语言 > 详细

java异常——Exception、RuntimException

时间:2018-08-19 00:53:31      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:point   except   class   处理   选择性   not   filesyste   throws   run   

一、ExceptionRuntimeException的区别

  •   Exception是RuntimeException的父类,使用了 Exception 的类都必须对异常进行处理(try / throw / throws)
  •        RuntimeException 可以由选择性的对异常进行处理(可以不处理)

二、常见的 RuntimeException(即RuntimeException的子类)

  • ClassCastException
  • FileSystemNotFoundException
  • IndexOutOfBoundsException
  • NullPointerException

java异常——Exception、RuntimException

标签:point   except   class   处理   选择性   not   filesyste   throws   run   

原文地址:https://www.cnblogs.com/linhuanjie/p/9499232.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!