Eclipse设置代码模板Code Template

  • 团队协作最好是使用相同的代码模板 Code Template,打开 Window -> Preference -> Java -> Code Style -> Code Template,然后展开 Comments 节点下的 Types 进行编辑(一般需要编辑该 Java 类的代码模板)。
  • 编辑 Code Template 如下
/**
 * @Description: ${todo}(这里用一句话描述这个类的作用)
 * @author ${user}
 * @since JDK 1.8
 * @version V1.0
 * Date:${date} ${time}
 * Copyright (c) ${year}, [email protected] All Rights Reserved. 
 * ${tags}
 */
  • 修改后的 Code Template 如下
/**
 * Hello World
 * @author Administrator
 * @since JDK 1.8
 * @version V1.0
 * Date:2019年5月30日 下午11:11:11
 * Copyright (c) 2019, [email protected] All Rights Reserved.
 */
public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

猜你喜欢

转载自www.cnblogs.com/wumz/p/10952758.html
今日推荐