How to reference a method in javadoc?

前端 未结 3 1304
忘掉有多难
忘掉有多难 2020-11-28 00:13

How can I use the @link tag to link to a method?

I want to change:

/**
 * Returns the Baz object owned by the Bar object owned by Foo ow         


        
3条回答
  •  渐次进展
    2020-11-28 00:44

    You will find much information about JavaDoc at the Documentation Comment Specification for the Standard Doclet, including the information on the

    {@link package.class#member label}

    tag (that you are looking for). The corresponding example from the documentation is as follows

    For example, here is a comment that refers to the getComponentAt(int, int) method:

    Use the {@link #getComponentAt(int, int) getComponentAt} method.

    The package.class part can be ommited if the referred method is in the current class.


    Other useful links about JavaDoc are:

    • JavaDoc Tool Reference
    • JavaDoc Guide
    • How to Write Doc Comments for the Javadoc Tool

提交回复
热议问题