It’s relatively common for a try block to be followed by several catch blocks to handle various types of exceptions. If the bodies of several catch blocks are identical, you can use the multi-catch feature (introduced in Java SE 7) to catch those exception types in a single catch handler and perform the same task. The syntax for a multi-catch is:

catch (Type1 | Type2 | Type3 e)

Each exception type is separated from the next with a vertical bar (|). The preceding line of code indicates that any of the types (or their subclasses) can be caught in the exception handler. Any number of Throwable types can be specified in a multi-catch.

最新文章

  1. Vue.js学习笔记(4)
  2. 集合和String
  3. AC日记——codevs 1688 求逆序对
  4. 161128、Redis 4.0发布及其新功能介绍
  5. conpot_usage简要说明
  6. wdcp-apache配置错误导致进程淤积进而内存吃紧
  7. Java并发编程:Lock
  8. dyld: Symbol not found: _OBJC_CLASS_$_UIBlurEffect
  9. 深入理解PHP对象注入
  10. oh-my-zsh配置
  11. (5)UIView常见属性
  12. CoolBlog开发笔记第5课:请求与响应
  13. java无需解压zip压缩包直接读取包内的文件名(含中文)
  14. ubuntu中利用qtcreator引用opencv249及采起采集卡的共享库
  15. redhat7.3 superset的离线安装
  16. 学习笔记TF025:自编码器
  17. gitlab 搭建自己的源代码管理器
  18. java从命令行接受多个数字求和输出
  19. MySQL笔记(八)存储过程练习&补充
  20. Win7建立FTP站点

热门文章

  1. 文件上传ajaxfileupload.js插件
  2. 软件工程 speedsnail 第二次冲刺5
  3. N层电梯只停一层情况下,求所有人爬楼层数最少
  4. Silverlight取得Session
  5. Ubuntu安装wps for linux
  6. 修改后的SQL分页存储过程,利用2分法,支持排序
  7. 大话RAC介质恢复---只有备份文件的恢复
  8. USB设备---URB请求快
  9. selenium+python登录登出百度,等待页面加载,鼠标定位
  10. the usage of key word "static" in java language