@return

Summary

Documents the return value of a function or method.

Syntax

@return description

Parameters

description
The documentation for the function or method return value.

Description

The @return tag is used for documenting the return value for a function or method.

It is not necessary to include information about the return type. The return type is automatically included in the generated documentation.

Examples

Documenting an 'add' Method
1
2
3
4
5
6
7
8
9
10
11
12
class Calculator
{
    /**
     * Adds two numbers together and returns the result.
     *
     * @return The result of the two numbers being added together.
     */
    int add(int x, int y)
    {
        return x + y;
    }
}

See Also

Share

HTML | BBCode | Direct Link