Http://www.cnblogs.com/fsjohnhuang/p/3988883.html
First, comments
1. Annotation types
[A]. Single-line Comment
Single-line comment String type = "single line comment";
[b]. Multiline comment
/ * Multi-line comment */string type = "Multiline comment";
[c]. Documentation Comments
/** * Documentation comments */public class dummy{}
2. Shortcut keys
[A]. Add/Cancel a single line comment: ctrl+/
[b]. Add a document comment for the class: ctrl+shift+j
Second, the note template
role: defines the default annotation format for files, classes, and methods, reducing the amount of manual input.
1. Set the entry for the comment template: click window->preference->java->code style->code Template, and then expand The comments node.
2. the elements under the comments node are described below:
file Node (document comment label)
/** * @Title: ${file_name} * @Package ${package_name} * @Description: ${todo} (describe the file in a word) * @author fsjohnhuang* @da Te ${date} ${time} * @version V1.0 */
Types Node (class comment label)
/** * @ClassName: ${type_name} * @Description: ${todo} (here is a word describing the role of this class) * @author fsjohnhuang* @date ${date} ${time} * ${ tags} */
Fields node (field comment label)
constructor Node (constructor comment label)
/** * <p>title: </p> * <p>description: </p> * ${tags} */
method Node (Methods comment label)
Press CTRL + C to copy the code<textarea></textarea>Press CTRL + C to copy the code
overriding Methods node (override method Comment label)
/** Title: ${enclosing_method}*description: * ${tags} * ${see_to_overridden} */
Delegate Methods Node (Proxy method comment label)
Getter Node (Getter Method Comment label)
/** * @return ${bare_field_name} * *
Setter Node (Setter method Comment label)
/** * @param ${param} to set the ${bare_field_name} */
3. Import and Export comment templates
Export comment Templates can be imported under the Window->preference->java->code style->code template.
Respect the original, reprint please indicate from: http://www.cnblogs.com/fsjohnhuang/p/3988883.html ^_^ Fat Boy John
Java Magic Hall: annotations and Comment templates (go)