Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java中的注释_Java_Nested_Comments - Fatal编程技术网

java中的注释

java中的注释,java,nested,comments,Java,Nested,Comments,我想知道我怎样才能写出这样的东西: this comment */ ends here 在java的注释中。我在网上搜索了一个小时,没有结果。如果我写: /* this comment */ ends here */ 然后,注释将在第一个*/处结束。 请注意,我想使用/**/注释,而不是//注释。 谢谢 /**/comment样式绝对需要两个字符对。它不允许结束字符对,注释末尾除外。我能回答的最接近我想你问的问题是: /* this comment */ /* ends here */

我想知道我怎样才能写出这样的东西:

this comment */ ends here
在java的注释中。我在网上搜索了一个小时,没有结果。如果我写:

/* this comment */ ends here */ 
然后,注释将在第一个*/处结束。 请注意,我想使用/**/注释,而不是//注释。
谢谢

/**/comment样式绝对需要两个字符对。它不允许结束字符对,注释末尾除外。我能回答的最接近我想你问的问题是:

/* this comment */
/* ends here */

/**/comment样式绝对需要两个字符对。它不允许结束字符对,注释末尾除外。我能回答的最接近我想你问的问题是:

/* this comment */
/* ends here */

因为*/对语言有价值,所以需要修改*/使之与众不同。 你能说

this comment * / ends here


因为*/对语言有价值,所以需要修改*/使之与众不同。 你能说

this comment * / ends here


不可以。不能在使用/*打开的注释中嵌入*/注释。遇到第一个*/时,注释将关闭。

否。不能在使用/*打开的注释中嵌入*/注释。遇到第一个*/时,注释关闭。

可以这样做:

/** this comment */ ends here */
&42;是*的HTML字符代码,将注释处理为文档时,只剩下*字符

例如:

/* this comment */// ends here */

/* this comment *//* ends here */

/* this comment */ /* ends here */

可以这样做:

/** this comment */ ends here */
&42;是*的HTML字符代码,将注释处理为文档时,只剩下*字符

例如:

/* this comment */// ends here */

/* this comment *//* ends here */

/* this comment */ /* ends here */

为什么要将*/嵌入注释中?我希望此注释/结束于此处的字符串位于/*/类型的注释中。这是我从学校学到的一个问题。你厌倦了转义字符吗?我现在明白了。Elliott已经给出了正确的答案,您不能在多行注释中嵌入*/为什么要在注释中嵌入*/呢?我希望此注释/在此结束的字符串-位于/*/类型的注释中。这是我从学校得到的一个问题。您厌倦了转义字符吗?我现在明白了。Elliott已经给出了正确答案,您不能在多行注释中嵌入*/是的。。。但从上下文来看,OP显然不是在谈论javadoc注释。。。但是从上下文来看,OP显然不是在谈论javadoc注释。哇,哇,哇,哇那真是不幸,不是吗。哇,哇,哇,哇