When coding in C# I have always found the tag remarks
very useful for providing notes about the implementation of a class or method, or to give information about the theory of what I was implementing. I am now using Java but I can't find an appropriate JavaDoc tag for this. Maybe in Java you accomplish this in a different manner, does anybody know?
Writing Javadoc Comments In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.
Also of interest here - the annotation is on the same line as the other qualifiers for the method. I've never seen that done before, but it seems to suggest that annotations should be treated much like other qualifiers for a method, and as such, the javadoc should definitely go before it.
From the main menu, select Tools | Generate JavaDoc. In the dialog that opens, select a scope — a set of files or directories for which you want to generate the reference, and set the output directory where the generated documentation will be placed.
Format of a Doc CommentA doc comment is written in HTML and must precede a class, field, constructor or method declaration. It is made up of two parts -- a description followed by block tags. In this example, the block tags are @param , @return , and @see .
With iteration 8 of the Java programming language, developers finally have been provided with three additional tags they can use in their code's documentation – and which should meet your needs: @apiNote
, @implSpec
and @implNote
(cf., for instance, for a more detailed discussion: blog.codefx.org/java/new-javadoc-tags/).
As far as I know, there isn't any dedicated Javadoc tag for notes or remarks. Generally, the first sentence of Javadoc should give a brief description of the class/method/field. Then the full description should follow. And if you want to include any notes, a specialized paragraph with a "Note:" prepended should suffice.
/** * Brief description. Full description of the method, generally without * implementation details. * <p> * Note: Additional information, e.g. your implementation notes or remarks. * </p> * @param input description of the parameter * @return description of return value * * @since version * @author name of the author */ public boolean doSomething(String input) { // your code }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With