How to add method description in Java? I am using NetBeans IDE.
Use javadoc comments - / ** This is a comment * /
Check out this link for detailed documentation http://en.wikipedia.org/wiki/Javadoc
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
See the manual and see the source code for some standard Java classes .
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.
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 .:-)
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.