/** * The annotation type {@code java.lang.annotation.Repeatable} is * used to indicate that the annotation type whose declaration it * (meta-)annotates is <em>repeatable</em>. The value of * {@code @Repeatable} indicates the <em>containing annotation * type</em> for the repeatable annotation type. * * @since 1.8 * @jls 9.6 Annotation Types * @jls 9.7 Annotations */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Repeatable {/** * Indicates the <em>containing annotation type</em> for the * repeatable annotation type. * @return the containing annotation type */ Class<? extends Annotation> value(); }
就是注解里面不加这个元注解的话不可以在一个方法上重复使用,加上这个元注解的注解就可以在同一个方法上重复使用。