@deprecated

Summary

Marks an item as being deprecated.

Syntax

@deprecated [reason]

Parameters

reason
The reason the item is deprecated.

Description

The @deprecated tag is used to mark an item (class, method, etc.) as being deprecated. Optionally, a reason for the deprecation of the item can be provided.

Examples

Deprecating 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.
     *
     * @deprecated Use the + operator instead.
     */
    int add(int x, int y)
    {
        return x + y;
    }
}

Share

HTML | BBCode | Direct Link