zl程序教程

您现在的位置是:首页 >  工具

当前栏目

idea设置类注释和方法注释

IDEA方法 设置 注释
2023-09-27 14:21:58 时间

类注释

1、file-->setting-->editor-->file and code templates-->includes--> file header
2、在右侧文件框编辑注释
/**
*description:
*author:${USER}
*time:${DATE}
*/

3、点击ok进行保存

方法注释

1、file-->setting-->editor-->livetemplates
2、点击右边绿色加号,选择template group,弹出窗口,随便起名。
3、file-->setting-->editor-->livetemplates
4、选择你刚才建立的group
5、点击右侧绿色+号,选择livetemplates,填写Abbreviation,注释的缩写名。打这个名,就可以添加注释。
6、在Templete text中编写注释,复制上方的即可
7、点击注释下方的define。选择注释作用域,勾选everywhere。
8、点击注释右侧的edit variables。设置参数的值,可选择默认表达式。
9、点ok配置完成。