InheritAnnotation

package com.yinbodotcc2.annotation.metaannotation;
import java.lang.annotation.Inherited;
@Inherited
public @interface InheritAnnotation
{
int value();
}
@interface NoInheritAnnotation
{
int value();
}
@InheritAnnotation(14)
@NoInheritAnnotation(16)
class A
{
}
//此时B自动有了@InheritAnnotation(14)
class B extends A
{
【InheritAnnotation】}

    推荐阅读