The @Deprecated annotation was first introduced in Java 5, while the Javadoc tag @deprecated was introduced in Java even earlier. The presence of the annotation forces the compiler to generate a warning that can be suppressed by the annotation:
Since Java 9, the annotation can have one or both the methods, namely since() and forRemoval():
@Deprecated(since = "2.1", forRemoval = true)
The since() method allows the setting of the API version (as String). It depicts the API version from where the particular class or method was deprecated. If not specified, the default value of the since() method is "" (empty String).
The forRemoval() method depicts the intent to remove the marked element (if true ...