Javadoc linking to a class in another package

前端 未结 2 1085
半阙折子戏
半阙折子戏 2020-12-15 02:46

I have two packages, Shapes and Fruits:

com.myproject.Shapes.
    Circle
    Square
    Triangle
com.myproject.Fruits.
    Apple
           


        
相关标签:
2条回答
  • 2020-12-15 02:56

    For another package use this syntax:

    {@link  package.class#member  label}
    

    In your case this should be:

    {@link com.myproject.Shapes.Square Square}
    

    If you want to show only the class name then use the label, if complete path is desired then label is not required.

    Reference: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#link

    0 讨论(0)
  • 2020-12-15 03:04

    The correct syntax variants are

    {@link [<package>.]<class>[#<method>]}
    {@link #<method>}
    

    You were missing a complete package. The following example should be correct

    {@link com.myproject.Shapes.Square} 
                         ^^^^^^
    
    0 讨论(0)
提交回复
热议问题