PDA

View Full Version : Java Comments


antagonist
12-12-2008, 07:59 AM
The Java programming language supports three kinds of comments:

/* text */
The compiler ignores everything from /* to */.

/** documentation */
This indicates a documentation comment (doc comment, for short). The compiler ignores this kind of comment, just like it ignores comments that use /* and */. The JDK javadoc tool uses doc comments when preparing automatically generated documentation.

// text

The compiler ignores everything from // to the end of the line.

Example

Java denotes comments in three ways:

1. Double slashes in front of a single line comment:

int i=5; // Set the integer to 5

2. Matching slash-asterisk (/*) and asterisk-slash (*/) to bracket multi-line comments:

/*
Set the integer to 5
*/
int i=5;

3. Matching slash-double asterisk (/**) & asterisk-slash(*/) for Javadoc automatic hypertext documentation, as in

/**
This applet tests graphics.
*/
public class testApplet extends applet{...

or

/**
* Asterisks inside the comment are ignored by javadoc so they
* can be used to make nice line markers.
**/

The SDK tool javadoc uses the latter /** ..*/ comment style when it produces hypertext pages to describe a class.

information taken from freejavaguide.com

LYRiiCz
12-12-2008, 08:01 AM
Rippped.
Gf mate.

http://mytamilchannel.com/forum/programming-coding-and-tutorial/how-to-comment-a-line-block-in-java/

-Ollie.

bombs pure
04-02-2009, 10:14 AM
Nice work, not what im lookin for tho