Introduction
In this tutorial, we will learn how to add @author comments to every new class that we create. We can achieve it using either of the following two solutions
Solution 1:
Automatically add @author comments to every new class using Files and Code Templates
Open File -> Settings -> Editor -> File and Code Templates -> Includes
Click on Includes. Under File Header, enter the following comments text
/**
* @author ${USER}
* @Date ${DATE}
*/
Intellij - add @author comments |
Solution 2:
Autocompletion of @authorOpen File -> Settings -> Editor -> Live Templates
- Select Java and then click on + button
- In Abbreviation, enter @a
- In template text, enter the following comments
/**
* @author ${USER}
* @Date ${DATE}
*/
- In option, Expands with select SPACE
Intellij - Autocompletion @author |
You can simply add the @author comments by typing @a and then click SPACE
I need to contact you Mr Asif. Can you share your email address please ?
ReplyDeleteplease leave your email address here , I will contact you back
ReplyDeletebut on auto completion the ${USER} should change into a username but what i get is ${USER} on auto completion is that the intended purpose?
ReplyDelete