Home > DeveloperSection > Interviews > What is a rules for defining annotation types

Posted on    July-15-2016 7:46 AM

 Java Java  Java I/O 
Ratings:
 1 Answer(s)
  156  View(s)
Rate this:

Jonas Stuart
Jonas Stuart

Total Post:11

Points:55
Posted on    July-15-2016 7:46 AM

 Rules for defining annotation types

·      An annotation declaration starts with @interface, followed by the annotations name.

·         To create parameters for an annotation, you declare methods in its type.

·         Method declarations should not contain any parameters.

·         Method declarations should not contain any throws clauses.

·         Return types of the method should be one of the following:

Primitive

String

Class

Enum


Modified On Jul-15-2016 07:47:52 AM

Don't want to miss updates? Please click the below button!

Follow MindStick