How can I add method description in Java ? I use NetBeans IDE.
simple thing is ,you just type /** and press Enter on the top of method ,where you want generate comment . it automatically generates the element comment .
A method in Java or Java Method is a collection of statements that perform some specific task and return the result to the caller. A Java method can perform some specific task without returning anything. Methods in Java allow us to reuse the code without retyping the code.
A class — in the context of Java — is a template used to create objects and to define object data types and methods. Classes are categories, and objects are items within each category. All class objects should have the basic class properties.
A method descriptor is a list of type descriptors that describe the parameter types and the return type of a method, in a single string.
You can use javadocs using /** comments */
For a 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 futher help http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#descriptions
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