Let's say I have an Annotation.
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyAnnotation {
int value() default 1;
}
Is there any way to get the value of 1
using reflection or something?
How about
MyAnnotation.class.getMethod("value").getDefaultValue()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With