TestMain.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:JavaZone 作者:
private static void annotationTypeAnnotation() {
    // @Target这个就是 此类型
    ClassBinds classBinds = Test.class.getAnnotation(ClassBinds.class);
    if (classBinds != null) {
        Annotation[] annotations = classBinds.annotationType().getAnnotations();
        Target target = classBinds.annotationType().getAnnotation(Target.class);
        if (target != null)
            System.out.print("ANNOTATION_TYPE---->targets:" );
        for (ElementType elementType : target.value()) {
            System.out.print("\t elementType:"+elementType);
        }
        System.out.println();
    }


}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号