java - @param 究竟是如何工作的 - Java

标签 java param

注解@param是如何工作的?

如果我有这样的事情:

/* 
*@param testNumber;
*/

int testNumber = 5;
if (testNumber < 6) {
   //Something
}

@param 将如何影响 testNumber?它甚至会影响 testNumber 吗?

谢谢。如果我用错了,请告诉我。

最佳答案

@paramjavadoc 用来生成文档的特殊格式注释。它用于表示方法可以接收的参数(或多个参数)的描述。还有@return@see分别用来描述返回值和相关信息:

http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format

除其他外,还有:

/**
 * 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) {

关于java - @param 究竟是如何工作的 - Java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16138217/

相关文章:

java - 使用具有透明图像的 Graphics.copyArea

java - 如何在不创建变量的情况下将值传递给数组?

Java 文档 - @return 和 @param

sql-server - T-SQL 相当于 Oracle 的 %TYPE 运算符?

JAVA:从 Hashmap 返回所有键值

java - 关于在 Java 中加载 Class 实例

java - 在 Tomcat 中部署 jBPM 7.8.0 - 无法使用 tomcat 用户登录

flash - 在对象参数中禁用 flash 音频?

javascript - 将字符串参数传递到 Javascript

android - 如何使用 Retrofit 查询 URL 中间的参数