Create Annotation instance with defaults, in Java
How can I create an instance of the following annotation (with all fields set to their default value). @Retention( RetentionPolicy.RUNTIME ) public @interface Settings { String a() default "AAA"; String b() default "BBB"; String c() default "CCC"; } I tried new Settings() , but that does not seem to work... Ralph To create an instance you need to create a class that implements: java.lang.Annotation and the annotation you want to "simulate" For example: public class MySettings implements Annotation, Settings But you need to pay special attention to the correct implementation of equals and