Is there a javadoc tag for documenting generic type parameters?

后端 未结 2 916
执念已碎
执念已碎 2020-12-07 23:38

I\'ve been looking through the javadoc documentation on Sun\'s site, trying to find if there\'s a javadoc tag which can be used to document a class or method\'s generic type

相关标签:
2条回答
  • 2020-12-08 00:10

    It should be done just like this:

    /**
     * @param <T> This describes my type parameter
     */
    class MyClass<T>{
    
    }
    

    Source

    0 讨论(0)
  • 2020-12-08 00:18

    Yes. Just use the @param tag, and include angle brackets around the type parameter.

    Like this:

    /**
     *  @param <T> This describes my type parameter
     */
    
    0 讨论(0)
提交回复
热议问题