Search code examples
javanetbeansjavadoc

How to add description to method or class


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

JavaDoc example


Solution

  • 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