If you want to repeat java 8 annotation, enable this.
Example:
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(MyAnnotationContainer.class)
@interface MyAnnotation {
String value();
}
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotationContainer {
MyAnnotation[] value();
}
@MyAnnotation( "a")
@MyAnnotation( "b")
class MyClass {
}
In the description, I read that this is just a hint at the java compiler to generate the code.
Clarify what this code looks like in java 5-7?
source
share