Java Documentation Comments Main use method

Source: Internet
Author: User

First, what annotations are included in Java

1.//is used for single-line comments.

The 2./*...*/is used for multiline annotations, starting from/* and ending with */, not nested.

3./**...*/is a comment statement that is unique to support the JDK tool Javadoc.exe. This is what we know about document annotations.

In the naming console: Use the command line to enter the Javadoc + file name in the directory where the target file resides. java.

Second, the key noun of document annotation

    /**<p> Tags for action </p> *@authorA class or method is typically used to describe an open person *@versionclass Version Description *@seea reference to the description of the class, attribute, method, or related topics *@parammethod Description of the method parameter *@throwsdescription of the method for the exception *@returndescription of the return value of the method * {@value} method, a class, a property that can be used to generate the value of a marked constant field. * {@inheritDoc} methods, classes can integrate comments from the previous document * {@link} class, Method link label * {@linkplain} class, Method link label, unique to the previous label is different because the font is different, if the label is a plain text, then use Linkplain *@sinceclasses, Methods Express which release version of the tagged element is introduced *@exceptionmethod is the same as @throws's usage *@serialData* <pre> method, class Yes, that's the HTML tag that's used to show "original look." */

A city example

1      Public voidAA () {2         3     }4     5     6     /**in general, these annotations are open enough for use.7      * @authorMingge8      * @since1.09      * @see#aa () View the AA methodTen      * @parama parameter a One      * @returnreturn Value Description A      * @throwsException Description -      */ -      Public intTestintAthrowsexception{ the         returnA; -}

I think a lot of details still need to learn, everyday study, progress every day!

Reference: https://hacpai.com/article/1402537988442

Java Documentation Comments Main use method

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.