我发现在日食中
/*
* Hello world, this is green.
*
*/
注释将为绿色。然而,
/**
* Hello moon, this is blue.
*
*/
如果我使用/ **,它将变成蓝色。所以为什么?有什么区别吗?
虽然/*
开始有规律的多行注释,/**
启动多行注释配套的javadoc
工具,它从你的评论生成HTML文档。
这是来自文档的示例:
/**
* Returns an Image object that can then be painted on the screen.
* The url argument must specify an absolute {@link URL}. The name
* argument is a specifier that is relative to the url argument.
* <p>
* This method always returns immediately, whether or not the
* image exists. When this applet attempts to draw the image on
* the screen, the data will be loaded. The graphics primitives
* that draw the image will incrementally paint on the screen.
*
* @param url an absolute URL giving the base location of the image
* @param name the location of the image, relative to the url argument
* @return the image at the specified URL
* @see Image
*/
public Image getImage(URL url, String name) {
try {
return getImage(new URL(url, name));
} catch (MalformedURLException e) {
return null;
}
}
Java API规范本身就是通过生成的HTML文档的示例javadoc
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句