Should Javadoc comments be added to the implementation?

前端 未结 7 622
醉酒成梦
醉酒成梦 2020-12-04 11:54

Is it correct practice to add Javadoc comments in the interface and add non-Javadoc comments in the implementation?

Most IDEs generate non-JavaDoc comments for imple

7条回答
  •  旧巷少年郎
    2020-12-04 12:18

    Both the implementation and the interface should have javadoc. With some tools, you can inherit the documentation of the interface with the @inheritDoc keyword.

    /**
     * @inheritDoc
     *
     * This implementation is very slow when b equals 3.
     */
    public foo(int b)
    { ... }
    

提交回复
热议问题