- 自定义Java注释模板
- 两个较为实用的快捷键
设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。
注释模板
/**
* @Title: ${file_name}
* @Description: ${todo}
* @author Jeremy
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
②Types 类
/**
* @ClassName: ${type_name}
* @Description: ${todo}
* @author Jeremy
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
③Fields 字段
/**
* @Fields ${field} : ${todo}
* @author Jeremy
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
④Constructors 构造函数
/**
* @Constructor: ${enclosing_type}
* @Description: ${enclosing_type}构造函数
* @author Jeremy
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
⑤Methods 方法
/**
* @MethodName: ${enclosing_method}
* @Description: ${todo}
* @author Jeremy
* ${tags} ${return_type}
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
⑥Overriding methods 重写方法
/**
* @MethodName: ${enclosing_method}
* @Description: ${todo}
* @author Jeremy
* ${tags}
* ${see_to_overridden}
* @date ${currentDate:date('yyyy-MM-dd hh:mm:ss')}
*/
如何使用注释及效果图
在需要添加注释的方法,类之前输入/** 然后回车,就会出现注释
两个较为实用的快捷键
1.public static void main
只需要输入main然后按下alt+?之后回车即可
扫描二维码关注公众号,回复:
8910675 查看本文章
2.System.out.println();
只需要输入syso然后按下alt+?即可
看完再赞已成习惯~对您有助点点关注~