O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required