Java Comments, Single Line Comment, Multi Line Comments, Java documentation Comment

preview_player
Показать описание
In this video we are going to learn Programming Constructs in java with Practical Example.

Single-Line Comment:
//text The compiler ignores everything from // to the end of the line.

Multi-Line Comment:
/* text */ The compiler ignores everything from /* to */.

Documentation Comment:
/** documentation */ This is a documentation comment and in general its called doc comment. The JDK javadoc tool uses doc comments when preparing automatically generated documentation.
Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML format from Java source code, which requires documentation in a predefined format.
Following is a simple example where the lines inside /*….*/ are Java multi-line comments. Similarly, the line which precedes // is Java single-line comment.

Java Doc Comment Parameters:

@author Adds the author of a class. @author name-text

@deprecated Adds a comment indicating that this API should no longer be used. @deprecated deprecatedtext

@exception Adds a Throws subheading to the generated documentation, with the classname and description text. @exception class-name description

@param Adds a parameter with the specified parameter-name followed by the specified description to the "Parameters" section. @param parameter-name description

@return Adds a "Returns" section with the description text. @return description

@see Adds a "See Also" heading with a link or text entry that points to reference. @see reference

@serial Used in the doc comment for a default serializable field. @serial field-description | include | exclude

@serialData Documents the data written by the writeObject( ) or writeExternal( ) methods. @serialData data-description

@serialField Documents an ObjectStreamField component. @serialField field-name field-type field-description

@since Adds a "Since" heading with the specified since-text to the generated documentation. @since release

@throws The @throws and @exception tags are synonyms. @throws class-name description

@version Adds a "Version" subheading with the specified version-text to the generated docs when the -version option is used. @version version-text

00:45 Overview of "Java Comments"
02:15 Practical Example of "Java Single Line Comment"

04:27 Practical Example of "Java Multi Line Comment"
05:40 Practical Example of "Java Documentation Comment"

Java tutorial playlist:
Рекомендации по теме