Saturday 20 January 2018

Javadoc: @return tag

@return tag is used to document the return value of the method.

Syntax
@return description

As per convention, do not use @return tag on void methods and constructors.

Arithmetic.java
package com.java.tags;

/**
 * 
 * @author Hari Krishna
 *
 * @param <T>
 *            Type of element to perform Arithmetic operations
 */
public interface Arithemtic<T extends Number> {

 /**
  * 
  * @param a
  *            First Operand
  * @param b
  *            Second Operand
  * 
  * @return sum of two operands a and b
  * 
  * @since Version 1.1
  * 
  */
 T sum(T a, T b);
}

javadoc is generated like below.




Previous                                                 Next                                                 Home

No comments:

Post a Comment