在eclipse中自定義代碼塊的註釋,添加作者,日期,項目名稱等信息

快捷鍵 ALT + SHIFT +J
在這裏插入圖片描述
效果如下圖

package com.itheima.servlet.demo1;
import javax.servlet.Servlet;
/**
 * author:gabriel_wei
 * date:2020年3月9日
 * project name:web01
 */
public class ServletDemo1 implements Servlet{
	
}

下面的內容轉子https://blog.csdn.net/Ren_gw/article/details/84565888

  1. 點擊Comments下的Files可對整個Java文件進行註釋:包括公司名稱,版權所屬,作者信息,日期等。
    /**
  • Title: ${file_name}

  • Description:

  • Company: icss.207.class

  • @author ${user}
  • @date ${date}
  • @version 1.0
    */
  1. 點擊Types對類進行註釋:
    /**
  • @Title: ${type_name}
  • @Description:
  • @author ${user}
  • ${tags}
  • @createTime date{date}{time}
    */
  1. 點擊Fields對字段進行註釋:
    /** ${field}*/

  2. 點擊Constructors對構造方法進行註釋:
    /**

  • Title:

  • Description:

  • ${tags}
    */
  1. 點擊Methods對方法進行註釋:
    /**
  • @Title: ${enclosing_method}
  • @Description:
  • @author ${user}
  • ${tags}
  • @date date{date}{time}
    */
  1. 點擊Overriding Methods對重寫方法進行註釋:
    /* (non-Javadoc)
  • Title: ${enclosing_method}

  • Description:

  • ${tags}
  • ${see_to_overridden}
    */
  1. Delegate methods對代表方法進行註釋:
    /**
  • ${tags}
  • ${see_to_target}
    */

Code–> Catch
${exception_var}.printStackTrace();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章