Details of the differences between @see and @inheritDoc

I looked at the JavaDoc link , and although I understand the main difference between @see (various links) and {@inheritDoc} (exporting comments of the Java class of the superclass) I need to clarify how things are really implemented.

In the Eclipse IDE, when I select "Generate Element Comments" for an inherited method (from overriding an interface or toString (), etc.), it creates the following comment

 /* (non-Javadoc) * @see SomeClass#someMethod() */ 

If I need to create a JavaDoc, I have to leave it on this, replace @see with {@inheritDoc} or include it in the bona fide JavaDoc as such:

 /** * {@inheritDoc} */ 

And when I do this, should I keep the class method flag of class #?

+54
java javadoc
Nov 11 '12 at 0:40
source share
1 answer

First of all, you should remove the original eclipse pattern because it is just noisy trash. Either put significant documents, or do not put anything. but the useless repetition of the obvious using IDE templates simply clutters the code.

second, if you need to create javadoc, then you have to make a comment with /** , otherwise it is not javadoc.

Finally, if you redefine, you should use @inheritDoc (assuming you want to add to the original documents, as @seh noted, if you just want to duplicate the original documents, then you do not need anything), @see should be used only for reference to other related methods.

+84
Nov 11 '12 at 1:01
source share



All Articles