Java Magic Hall: annotations and Comment templates

Source: Internet
Author: User

First, comments

1. Annotation types

[A]. Single-line Comment

// single-line comment " single-line comment ";

[b]. Multiline comment

/*  */" Multiline comment ";

[c]. Documentation Comments

/**/Publicclass 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 * @date ${date} ${time} * @version V1.0   */

Types Node (class comment label)

/**/

Fields node (field comment label)

/**/

constructor Node (constructor comment label)

/**/

method Node (Methods comment label)

/* * * @Title: ${enclosing_method} * @Description: ${todo} (here is a word describing the function of this method) * @param ${tags}  parameter description * @return ${return_ Type}    * /

overriding Methods node (override method Comment label)

/**/

Delegate Methods Node (Proxy method comment label)

/**/

Getter Node (Getter Method Comment label)

/**/

Setter Node (Setter method Comment label)

/**/

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.