为什么我会收到错误"属性值必须保持不变".是不是空不变???
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SomeInterface {
Class<? extends Foo> bar() default null;// this doesn't compile
}
Run Code Online (Sandbox Code Playgroud) 根据Annotation default "null" value,在注解中禁止空值作为默认值。我想知道为什么。这是什么原因?