You can use deprecated annotations by simply preceding the class, method, or member declaration with “@Deprecated.” The deprecated annotations are used to deprecate a class, method, or field.