Wednesday, 25 June 2014

Declaration Context

Declaration Context : Where Annotations Apply to Declarations

There are eight declaration contexts, each corresponding to an enum constant of java.lang.annotation.ElementType.

1. Package Declarations

2. Type Declarations : include class, interface, enum and Annotation type declarations.

3. Method Declarations

4. Constructor Declarations

5. Type Parameter declarations of generic classes, methods, interfaces and constructors.

6. Field declarations including enum constants

7. Formal and Exception parameter declarations (A catch clause declares exactly one parameter, which is called an exception parameter)

8. Local variable declarations (including loop variables of for statements
and resource variables of try-with-resources statements)







Prevoius                                                 Next                                                 Home

No comments:

Post a Comment