Computer Science Canada

In Java; how would you do comment lines?

Author:  hosamhelal [ Fri Feb 25, 2005 5:12 pm ]
Post subject:  In Java; how would you do comment lines?

How can you put comment lines in Java?

in turing:

%Nice program
%By Me

How would you do that in Java?

Author:  rizzix [ Fri Feb 25, 2005 5:40 pm ]
Post subject: 

There are 3 types of comments in java:

the Line Comment: this type of comment starts with a // and ends at the end of line (just like the turing %). It i used as follows:
code:
someJavaCode(); // all this part is commented of


the Comment Block: this type of comment begins with a /* and ends with a */ and it can span multiple lines: It is used as follows:
code:
someJavaCode(); // a line comment
/* here begins
    the block comment
    and here shall it end */


the In-Code Documentation Comment: this type of comment is smilar to the Comment Block except that it strarts of with a /** (yes a double astrick) and is used for a different purpose. Special @tags can be used within such a comment that get parsed by the javadoc tool and result in an html-based documentation files, like the J2SE API Reference Documentation


: