简体   繁体   English

#在Java方法中有什么作用?

[英]What does # do in Java methods?

I've seen some notation or style like Region#layoutInArea() for example. 我已经看到了一些符号或样式,例如Region#layoutInArea() How does this act on a method? 这如何作用于方法? Is it related to the dot ( . ) accessor? 它与点( . )访问器有关吗?

That notation Region#layoutInArea() is not code - it's the way you refer to a method in javadoc. Region#layoutInArea()这个符号不是代码-这是您在javadoc中引用方法的方式。

Using it will create a hyperlink in the rendered documentation that links to the specified method's javadoc. 使用它会在呈现的文档中创建一个超链接,该超链接链接到指定方法的javadoc。

An example of its use: 其用法示例:

/**
  * Does something.
  * @see Region#layoutInArea()
  */
public void doSomething() {
    //
}

It could used in other tags too, like @link . 它也可以在其他标签中使用,例如@link

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM