Some Restrictions : Annotations Types « Language « Java Tutorial






  1. No annotation can inherit another.
  2. All methods declared by an annotation must be without parameters.
  3. Annotations cannot be generic.
  4. They cannot specify a throws clause.

They must return one of the following:

A simple type, such as int or double,
          An object of type String or Class
          An enum type
          Another annotation type
          An array of one of the preceding types








1.13.Annotations Types
1.13.1.Annotations and Annotation Types
1.13.2.The Annotation Interface
1.13.3.Using Default Values
1.13.4.Marker Annotations
1.13.5.Single-Member Annotations
1.13.6.Creates and uses a single-member annotation
1.13.7.The single-value syntax
1.13.8.Some Restrictions
1.13.9.A marker annotation