Java comments are
used in a program for documentation purpose. Comments give clarity to the
source code and make it more understandable. Java comments are not programming
statements are ignored by the java compiler. This is to help the programmers or
users to communicate and understand the program.
Java supports the
following type of comments,
- /*Some comment*/
- //Some other comment
- /** Documentation comment */
/*Some comment*/
This type of comment
is used to place more than one sentence of statements in comment. Everything
between the two delimiters is ignored by the compiler.
//Some comment
This is a single
line comment. Any statement of sentence inline with “//” is considered as
comment by the complier.
/**Documentations
comment*/
This is used to
indicate some special documentation comments. These comments are used to
document the working of a class and its member functions works.
No comments:
Post a Comment