【发布时间】:2013-08-18 01:45:31
【问题描述】:
在 Netbeans 中,您可以执行诸如编写“psvm”然后按 Tab 并生成
public static void main(String[] args) {
//your cursor is placed here.
}
类似地,还有编写循环、尝试 catch 块、instanceof 检查和类似的东西的方法。有没有类似这种方法的方法来生成变量的空检查?
我想要这样的东西:
ResultSet rs;
rs //pressing some magic button like ctrl+space or "rs null<TAB>"
//and a code like this would be generated:
if (rs != null) //your cursor will be placed here.
或
if (rs != null)
{
//your cursor here
}
【问题讨论】:
-
是的,查看首选项,有一个地方可以让您编写自己的自动完成功能。
-
是的,我开始深入研究,应该早点完成。还不知道怎么用语言写,等我弄明白了就写,也写在答案里。
标签: java netbeans autocomplete isnull