首页 > 代码库 > Java文法(4)—comments
Java文法(4)—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 EndOfLineComment TraditionalComment: / * CommentTail EndOfLineComment: // CharactersInLine opt CommentTail: * CommentTailStar NotStar CommentTail CommentTailStar: / * CommentTailStar NotStarNotSlash CommentTail NotStar: InputCharacter but not * LineTerminator NotStarNotSlash: InputCharacter but not * or / LineTerminator CharactersInLine: InputCharacter CharactersInLine InputCharacter 说明: These productions imply all of the following properties: • Comments do not nest. • /* and */ have no special meaning in comments that begin with //. • // has no special meaning in comments that begin with /* or /**. As a result, the text: /* this comment /* // /** ends here: */ is a single complete comment. The lexical grammar implies that comments do not occur within character literals (§3.10.4) or string literals (§3.10.5).
Java文法(4)—comments
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。