How to add a description to a method or class

How to add method description in Java? I am using NetBeans IDE.

JavaDoc example

+7
source share
6 answers

Use javadoc comments - / ** This is a comment * /

Check out this link for detailed documentation http://en.wikipedia.org/wiki/Javadoc

+14
source

You can use javadocs using / ** comments * /

For the method, basically you can have

/** The Desciption of the method to explain what the method does @param the parameters used by the method @return the value returned by the method @throws what kind of exception does this method throw */ 

You can use this link for further assistance http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#descriptions

+8
source
+3
source

Writing comments above your method should do what you want Example:

 /** This method does some serious stuff */ public int getN() { return n; } 

If you use javadocs, this should be a description of the method.

+2
source

Everything is here: http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/index.html .

I add this sentence because my answer above is too short for SO .:-)

+2
source

I assume the IDE is looking for javadoc definitions in the source files. Thus, you need to attach the sources to the libraries used in the project.

+2
source

All Articles