3.7. Comments

There are two kinds of comments.

/* text */

A traditional comment: all the text from the ASCII characters /* to the ASCII characters */ is ignored (as in C and C++).

// text

An end-of-line comment: all the text from the ASCII characters // to the end of the line is ignored (as in C++).

Comment:    TraditionalComment    EndOfLineCommentTraditionalComment:    / * CommentTailEndOfLineComment:    / / CharactersInLineoptCommentTail:    * CommentTailStar    NotStar CommentTailCommentTailStar:    /    * CommentTailStar    NotStarNotSlash CommentTailNotStar:    InputCharacter but not *    LineTerminatorNotStarNotSlash:    InputCharacter but not * or /    LineTerminatorCharactersInLine:    InputCharacter    CharactersInLine InputCharacter ...

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.