Error setting a default null value for an annotation’s field

Try this

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SomeInterface {
    Class bar() default void.class;
}

It does not require a new class and it is already a keyword in Java that means nothing.

Leave a Comment