[英]Is there a shortcut to add exceptions to a method signature in Eclipse?
I am using the Eclipse IDE for Java and I want to know if there is shortcut to add exceptions in a method signature. 我正在使用Eclipse IDE for Java,我想知道是否有在方法签名中添加异常的快捷方式。 Like if I am writing a method and I used
bufferedreader.readline()
, is there a shortcut to add the declaration throws IOException
instead of writing it myself . 就像我正在编写一个方法并且我使用
bufferedreader.readline()
,是否有一个添加声明的快捷方式throws IOException
而不是自己编写它。
When you hover your mouse over the statement, you will get the below popup. 当您将鼠标悬停在语句上时,您将看到以下弹出窗口。 You just have to click on the
Add throws declaration
link 您只需单击
Add throws declaration
链接即可
You can also press Ctrl+1
for a similar popup, when your keyboard cursor is on the statement line. 当键盘光标位于语句行上时,您也可以按
Ctrl+1
进行类似的弹出窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.