Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add description to method or class

How can I add method description in Java ? I use NetBeans IDE.

JavaDoc example

like image 690
Talha Avatar asked Mar 20 '13 09:03

Talha


People also ask

How do you add comments to a method?

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 .

What is method description in Java?

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.

What is a class description in Java?

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.

What is method descriptor?

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.


1 Answers

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

like image 185
Lakshmi Avatar answered Sep 23 '22 14:09

Lakshmi