自学内容网 自学内容网

Eclipse新建类的时候如何自动添加注释

Eclipse新建类的时候如何自动添加注释

主要有两种方法:①创建类文件时自动添加注释;②文件注释

方法一:类注释

  • windows -> preferences
  • Java -> Code Style -> Code Templates
  • Code -> new Java files
  • edit

image-20240412160126419

  • 填入下面的数据
${filecomment}
${package_declaration}
/**
* @author 作者 E-mail:
* @version 创建时间:${date} ${time}
* 类说明
*/
${typecomment}
${type_declaration}

方法二:文件注释

  • windows -> preferences
  • Java -> Code Style -> Code Templates
  • Comments -> Files -> edit

image-20240412160423284

  • 插入注释
${filecomment}
${package_declaration}
/**
* @author 作者 E-mail:
* @version 创建时间:${date} ${time}
* 类说明
*/
${typecomment}
${type_declaration}

参考材料

Eclipse新建类的时候如何自动添加注释(作者,时间的信息)


原文地址:https://blog.csdn.net/qq_44579321/article/details/137684785

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!