Saturday 20 January 2018

Javadoc: @param tag

By using @param tag, we can document the description of method parameters.

Syntax
@param parameter-name description

This tag is valid only in a documentation comment for a method, constructor, or class.

The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor. Use angle brackets around this parameter name to specify the use of a type parameter.

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);
}





Previous                                                 Next                                                 Home

No comments:

Post a Comment