[英]Using try with resources in Java
From the documentation you linked: "Note: A try-with-resources statement can have catch and finally blocks just like an ordinary try statement. In a try-with-resources statement, any catch or finally block is run after the resources declared have been closed ." 从您链接的文档中:“注意:try-with-resources语句可以具有catch和finally块,就像普通的try语句一样。在try-with-resources语句中,任何catch或finally块都在声明的资源拥有之后运行已关闭 。”
So, no. 所以不行。 You don't need to.
不用了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.