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新建类的时候如何自动添加注释(作者,时间的信息)

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-13 05:14:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-13 05:14:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-13 05:14:01       82 阅读
  4. Python语言-面向对象

    2024-04-13 05:14:01       91 阅读

热门阅读

  1. FlashDB学习笔记一

    2024-04-13 05:14:01       36 阅读
  2. CSS学习笔记

    2024-04-13 05:14:01       43 阅读
  3. HTML&CSS(二)---HTML常见标签

    2024-04-13 05:14:01       31 阅读
  4. 2024.4.12清空Google剩余的几个网址

    2024-04-13 05:14:01       42 阅读
  5. Objective-C网络请求开发的高效实现方法与技巧

    2024-04-13 05:14:01       42 阅读
  6. C++ 设计模式

    2024-04-13 05:14:01       39 阅读
  7. mysqlySQL中启用慢查询日志并设置阈值

    2024-04-13 05:14:01       33 阅读