快乐随行

导航

2021年4月13日 #

JAVA 中的异常(4)- 异常的处理方式三:try-with-resource

摘要: Java 1.7中新增的try-with-resource语法糖来很好的解决这种因为关闭资源引起的异常屏蔽问题。 public void testExcep(){ BufferedInputStream in = null; BufferedOutputStream out = null; try 阅读全文

posted @ 2021-04-13 09:06 快乐随行 阅读(179) 评论(0) 推荐(0) 编辑