[英]/* and /** for javadoc - just Eclipse or is this a Java convention?
I noticed that in Eclipse when I use 我注意到在使用Eclipse时
/*
* My Comment
*/
public class myClass {
}
"My Comment" does not associate with the class but “我的评论”与课程无关,但
/**
* My Comment
*/
public class myClass {
}
"My Comment" does “我的评论”确实
Similarly 同样
/** myComment */
public static final String MY_VARIABLE = "testing";
also associates with the javadoc. 还与javadoc关联。
Is this a Eclipse thing or part of the java documenting system. 这是Eclipse还是Java文档系统的一部分。
Should I always use /** as opposed to /* ? 我应该始终使用/ **而不是/ *吗?
It is how Javadocs wants the comments and Javadoc is the de-facto industry standard. 这就是Javadocs想要注释的方式,而Javadoc是事实上的行业标准。 ( Sun's How to write Doc Comments )
( Sun的“如何编写文档注释” )
Other tools such as doxygen also support the Javadoc style, so you should always use /**
for comments documenting a class, method or variable when developing in Java unless there is a good reason otherwise. 其他工具(例如doxygen)也支持Javadoc样式,因此,除非有充分的理由,否则在使用Java开发时,应始终使用
/**
进行注释以记录类,方法或变量。 For general comments /*
should be used 对于一般评论,应使用
/*
Yes, you should use /**
to associate it; 是的,您应该使用
/**
进行关联; not /*
. 不是
/*
。 Thanks 谢谢
/* My Comment */ is usually used for making a comment block.
/** MyComment */ is usually used for documentation purposes, such as desribing variables and things like that.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.