Eclipse uses automatic commenting: Set the following template under the Eclipse tool's Window\preferences\java\code Style\code templates\comments
Files Comment Label
/**@author@version* /
Special Note: for the "${user}" configuration, if you want to configure your own custom name, such as: Zhang San, you will need to find it in the Eclipse/myeclipse directory eclipse.ini/ Myeclipse.ini file, add a startup parameter behind-vmargs:-duser.name= Zhang San, and restart MyEclipse tool "* @author ${user}" will change to "* @author Zhang San".
Type (Types) Comment Label (Note for Class)
/** * @ClassName: ${type_name} * @Description: ${todo} (here is a sentence describing the role of this Class)@author */
field (fields) Comment label
/** * @Description: ${todo} (here is a word describing the role of this class) */
Constructor tags
/***/
Method (Constructor & Methods) label
/** * @Title: ${enclosing_method} * @Description: ${todo} (here is a word describing the effect of this method)@return @throws* /
Override method (overriding Methods) label
/** @throws* /
Proxy method (Delegate Methods) label
/** * @Title: ${enclosing_method} * @Description: ${todo} (here is a word describing the function of this method)@throws* /
Getter Method Label
/** * @Title: Returns the value of ${bare_field_name} @return* /
Setter Method Label
/** @param* /
After the settings are complete, you can enter/** and then enter to add comments automatically.
Eclipse automatically adds a comment template