------------------------------------------------------------------------------------------------------Description: there is, 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 I N C + +).------------------------------------------------------------------------------------------------------- Grammar: Comment:traditionalcomment endoflinecomment traditionalcomment:/* commenttail Endoflinecomment://Charactersinline opt commenttail: * Commenttailstar Notstar Commenttail Commenttailstar:/* Commenttailstar Notstarnotslash commenttail notstar:inputcharacte R but not * LineTerminator notstarnotslash:inputcharacter and not * or/lineterminator CHaractersinline:inputcharacter charactersinline Inputcharacter Description: These productions imply all of The following properties: comments does not nest. /* and * * has no special meaning in comments this begin with//. //have no special meaning in comments this begin with/* or/**. As a result, the text:/* This comment/*///** ends here: */is a and complete comment. The lexical grammar implies that comments does not occur within character literals (§3.10.4) or string literals (§3.10.5).
Java Grammar (4)-comments