大纲 设置代码补全模版
设置代码模版
官方常用 Java 代码模版的使用方式如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 fori:输出 For 循环的代码结构 itar:输出完整的 For 循环代码结构 iter:输出增强 For 循环的代码结构 ifn:输出判断上一个变量是否为空的代码 inn:输出判断上一个变量是否不为空的代码 xx.nn:输出判断指定变量是否不为空的代码 xx.null:输出判断指定变量是否为空的代码 psvm:输出 Main 方法 psf:输出 public static final prsf:输出 private static final psfi:输出 public static final int psfs:输出 public static final String list.fori:输出遍历集合变量的 For 循环代码结构 list.for:输出遍历集合变量的增强 For 循环代码结构 list.forr:输出倒序遍历集合变量的 For 循环代码结构 souf:输出 System.out.printf() sout:输出 System.out.println() xx.sout:输出指定变量的值: System.out.println(xx) soutm:输出方法名:System.out.println("Util.hexDecode"); soutp:输出方法参数:System.out.println("hex = [" + hex + "]"); soutv:输出上一个变量的值:System.out.println("bytes = " + bytes);
新增自定义代码模版
设置代理
设置 JVM 使用代理 JVM 只支持 Http 代理,不支持 Socket 代理 界面操作路径:选中工程 –> Run –> Edit Configurations –> Application JVM 配置参数示例: -Dhttp.proxyPort=8118 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=8118 -Dhttps.proxyHost=127.0.0.1 -Dhttp.nonProxyHosts=”localhost|127.0.0.1|*.aliyun.com”
常用断点调试技巧 IntelliJ IDEA 支持条件断点,即在断点调试的时候,在循环里增加条件判断,这样可以极大地提高断点调试效率。具体操作方法:在断点处右击调出条件断点设置窗口,填写条件(必须是返回布尔型的结果),然后在 Debug 模式下重新启动应用,就可以在满足某个条件下实施断点调试。在 IntelliJ IDEA 里进行断点调试时,还可以使用查看表达式的值(ctrl + u)来调试代码。