Overridden methods in JavaDoc

前端 未结 2 1393
粉色の甜心
粉色の甜心 2021-01-01 08:07

I\'m documenting a Java program that I have developed, and wanted to know if JavaDoc will be generated for an inherited method (which is overridden) if I just document the s

2条回答
  •  执念已碎
    2021-01-01 08:55

    [I] wanted to know if JavaDoc will be generated for an inherited method (which is overridden) if I just document the superclass?

    Yes. If you don't have javadoc comments on a subclass, javadocs will be be generated based on the superclasses javadoc.

    If you define javadocs in the subclass they will replace the inherited javadocs, but you can use {@inheritDoc} to include the respective superclass javadoc comments in the subclass javadocs.

    Reference:

    • https://docs.oracle.com/javase/6/docs/technotes/tools/solaris/javadoc.html#inheritingcomments

提交回复
热议问题