mooc-IDEA live template--006

十二、IntelliJ IDEA -live template

以定时器为例:

1、创建一个Template Group。。。

2、在创建的Template Group下面,创建一个Live Template

此时回到Java类,写上main-》Alt+Enter,即可调用Live Template

另:经常会配置live template模版有:

【1】main

【2】psfi, psfs (自定义)

如定义:private static final int DEFAULT_AGE=18; 可配置成live template

【3】pi(private int),ps(private String),psc(private String 且带有注释)

在代码中敲pic,则会自动打印,填写注释后,回车,光标即可定位到int后输入名称处!

以下为创建的四种属性,带注释与不带注释情况:

 

原文地址:https://www.cnblogs.com/kaixinyufeng/p/8847525.html