Class comment

IDEA - Settings - Editor - File and Code Templates - Class

/**
* @description: ${description}
*
* @author: YOUR NAME or {USER}
*
* @create: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}
*/

enter template


Method Comment

IDEA - Settings - Editor - Live Templates - create a new Template Groups. I my case i create a Template Groups named “Method Comment”.

create a new tmplate groups

Then select “Method Comment” add a new Live Template

NOTICE: there is no / in first line

**
* @Description: $description$
* @Param: $params$
* @return: $returns$
* @Author: IamXGW
* @Date: $date$
*/

Input Abbreviation, you will use this Abbreviation to create your method comment

enter template

sellet application in

edit variables


USE

Class Comment

When you create a new Java class, class comment will auto create.

Method Comment

  • Create a new method
  • Input “/ + your abbreviation + Enter” at the new added method top, in my case, i will input “/ + mc + Enter”
  • Then, you will get a method comment