Java Reference
In-Depth Information
To
java.lang.annotation
, JDK 8 adds the annotations
@Repeatable
and
@Native
.
@Repeatable
supports repeatable annotations, which are annotations that can be applied
more than once to a single item.
@Native
is used to annotate a constant field accessed by
executable (i.e., native) code. Both are special-use annotations that are beyond the scope
of this topic.
Here is an example that uses @
Deprecated
to mark the
MyClass
class and the
getMsg(
)
method. When you try to compile this program, warnings will report the use of these de-
precated elements.