Java programs can have two kinds of comments. implementation comments and
documentation comments. Implementation comments are those found in C++, which
are delimited by /*...*/, and //. Documentation comments (known as "doc
comments") are Java-only, and are delimited by /**...*/. Doc comments can
be extracted to HTML files using the javadoc tools.
In Java Technology, we can add comments to
Java source code in three ways which are given bellow:
1  public class TestComment{
2   // comment on one line
3  public static void main (String [ ] args){
4   /* comment on one
5   * or more lines
6   */
7   System.out.println(”Comments in Java”);
8  }
9  /** documentation comment
10  * can also span one or more lines
11  */
12  }
0 comments:
Post a Comment