Intellij idea 快捷键(3)--生成常用代码

上篇已经讲过一些生成常用代码块的代码.接下来再补充一些常用的.。


在使用Intellij idea 开发过程中,一些快捷生成代码块的操作简直是不能再爽more 了, 而且会让你感觉使用起来非常自然,非常舒服。

一个点引出,再加上常用的自动补全 ctrl +shift + enter , 开发效率奇快.


1.对于String 类型

"test".sout //输出
System.out.println("test");

"test".cast //转换
((光标位置) "test")

"test".field //
 
   

"test".format //字符串格式化
String.format("test", 光标位置)


"test".inst  ||  "test".instanceof
"test" instanceof  ? ((光标位置) "test") : null;


"test".nn
"test".notnull
 
   
if ("test" != null) {
    
}

"test".null
f ("test" == null) {
    
}

"test".par
("test")

"test".return
return "test";


"test".synchronized
synchronized ("test") {
    
}

"test".try
try {
    "test"
} catch (Exception e) {
    e.printStackTrace();
}

"test".var



2.对于boolean类型

可以看到一个"." 就能引出相关的快捷方法,不细表.




3.对于数值类型

增加for循环快捷.如图:



总:intellij idea 的快捷生成代码使整个编码过程非常的流畅,没有断裂感,  一个点 引出一串思路呀~~

版权声明:本文为博主原创文章,未经博主允许不得转载。转载请注明来源:http://blog.csdn.net/mingjie1212。欢迎交流学习! https://blog.csdn.net/mingjie1212/article/details/51923751

猜你喜欢

转载自blog.csdn.net/weixin_33400820/article/details/80226283
今日推荐