Types
of Java Comments
There are
three types of comments in java programming language:
1.
Single-Line Comments
2.
Multi-Line Comments
3.
Documentation Comments
1.
Single-Line Comments
The single
line comments are used to comment only one line. The single-line
comment starts with two forward slashes (//).
Syntax:
//This is a single line comment
2.
Multi-Line Comments
Multi-line
comments are used to enter a paragraph or strings. A multi-line comment is used to describe a full method in a code/program.
Multi-line comments start with /* symbol and end with */ symbol.
Syntax:
/*
This
is
a
multi-line
comment
*/
3.
Documentation Comments
The Documentation comments are used generally when writing
code for a project, since it helps to generate a documentation
page for reference, which can be used for getting information about
method present, its parameters, etc.
The documentation
comments are used to create documentation API. To create documentation
API, we need to use javadoc tool.
Syntax:
/**Comment
start
*
*This is a
documentation comment
*
*comment
ends
*/
3 Comments
Thanks for your information, it was really very helpfull..
ReplyDeletejava代做
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck 统计学补习
ReplyDeleteThank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. HTML Tutorial
ReplyDelete