【工具】——IDEA代码快捷键
main函数:psvm
System.out.println:sout
for(int i=0;i<5;i++):5.for
for (Annotation annotation : annotations):annotations.for
try…catch:alt+enter + 选择
重构方法:alt + enter + 选择
单行注释:ctrl + /
多行注释:ctrl + shift + /
查看函数:ctrl + 鼠标左键(放在函数名上)
创建构造方法:alt + insert + 选择construct + 选择参数(可以按住ctrl多选)
创建Gitter和Setter:alt + insert + 选择construct + 选择属性(可以按住ctrl多选)
复制当前行代码到下一行:ctrl + d
复制多行的同一位置代码(比如变量名等):alt + 选择
利用快捷键可以快速提高我们敲码的速度,如何自动生成返回值呢?
我们只要把鼠标光标移动到需要生成的语句那里,然后按快捷键 ctrl+alt+v就可以啦