Comments and embedded documents in Java

Source: Internet
Author: User

Excerpt from Think in Java

See a colleague wrote the Android program, comments like the Android source code, and then look at their own writing, they do not understand the comments. So take the time to read the Think in Java inside comments and embedded document chapters, and make a simple summary memo.

Comments in Java are divided into two types,////*/

Embedded documents use a special annotation syntax that generates HTML documents using the Javadoc tool (the Javadoc tool is part of the JDK installation) and can be viewed with a Web browser.

Grammar:

All Javadoc commands are only valid in comments after/**.

Embedded documents have two main types of embedded HTML and document tags, where the document label is divided into separate document labels (some commands that start with the @ character and are placed at the top of the comment line) and in-line document labels (which can appear anywhere, but need to be enclosed in curly braces).

Type:

There are three types of embedded documents, each placed in front of the class, domain, and method. Where Javadoc only generates documentation comments for members of public and protected.

Examples of Tags:

@see references to other classes of documents

@see Classname#method-name

See also for hyperlinks

{@link Package.class#method label} The label is similar to the @see, except that it is used in the row. Label as hyperlink text

There are other common

@version

@version version-information

@author

@author author-information

@param parameter-name Description

@return Description

@throws class-name Description

@deprecated

Comments and embedded documents in Java

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.