十二、IntelliJ IDEA -live template

以定时器为例:

1、创建一个Template Group。。。

mooc-IDEA live template--006

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

mooc-IDEA live template--006

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

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

【1】main

【2】psfi, psfs (自定义)

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

mooc-IDEA live template--006

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

mooc-IDEA live template--006

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

mooc-IDEA live template--006

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

mooc-IDEA live template--006

 

相关文章: