问题描述
在与Eclipse的编码,你怎么当你开始多行注释关闭*评论说,上来?
When coding with Eclipse, how do you turn off the "*" comments that come up when you start a multi-line comment?
而不是看到这一点,
/**
* Here is a comment
* some more
*/
我能得到这个?
/**
Here is a comment
some more
*/
如果你想知道的/ **,是因为我使用doxygen的。
If you are wondering the "/**" is because I use doxygen.
推荐答案
作为的,你只能做到这一点(意为转到
As mentioned in this thread, you can only do that (meaning "disabling the leading asterisks") by going to
Preferences > Java > Code Style > Code Templates
因此,例如,如果您修改模板字段的意见为:
So for example, if you modify the template for comments of a field into:
/**
*/
这会这样(中间无任何星号)时,你会评论的字段。
It will come that way (without any asterisk in the middle) when you will comment a Field.
然而,它确实违背 太阳约定用于Java注释格式高达JDK1.3(更新:的)(如图<一个href=\"https://web.archive.org/web/20120626135530/http://java.sun.com/docs/$c$cconv/html/$c$cConventions.doc4.html#16838\"相对=nofollow>也在这里)...结果
然而,如注意到in由:
However, it does go against the Sun convention for Java comment formatting up to jdk1.3 (update: current oracle link) (as seen also here)...
However, as noted in the comments by Amedee Van Gasse:
用的Javadoc 1.4,。
这是更简单的方法(如果你只需要做到这一点对你的codeS的一些意见,同时保持另一个与标准样式),当一个多行注释出现像这样的:
An even simpler way (if you only need to do that for certain comments of your codes, while keeping the other one with the standard style) is, when a multi-line comment appear like this one:
/**
*
*/
,你可以先删除一个领先的星号,则输入您的意见。结果
你会看到没有其他领先的星号表示在注释每个新行的开始了。
, you can first remove the one leading asterisk, the enter your comments.
You will see no other leading asterisks are showing up at the beginning of each new line of comments.
/**
*/
/**
My first line of comment
My second line of comment
My third line of comment
*/
这篇关于我如何在Eclipse多行注释关闭'*'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!