Types of Annotations

suggest change

There are three types of annotations.

  1. Marker Annotation - annotation that has no method
@interface CustomAnnotation {}
  1. Single-Value Annotation - annotation that has one method
@interface CustomAnnotation {  
    int value();  
}
  1. Multi-Value Annotation - annotation that has more than one method
@interface CustomAnnotation{  
    int value1();  
    String value2();  
    String value3();  
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents