当你想用代码片断捕捉异常时
(1)在编辑器里选中这个片断,
(2)按 Ctrl-Alt-T ( Code | Surround with… )
(3)然后选择“ try/catch ”。
它会自动产生代码片断中抛出的所有异常的捕捉块。
在 Options | File Templates | Code tab 中你还可以自己定制产生捕捉块的模板。
在idea中添加try/catch的快捷键
猜你喜欢
转载自blog.csdn.net/qq_42859864/article/details/82257131
今日推荐
周排行