type是加在类上面的注释:
用的时候,直接在class上面注释就行了:注释是以annotation对象的形式存在的
获取注释对应属性值的方法:
ans的长度是2
不用new bird 这样就可以了:MyAnnotation bb=Bird.class.getAnnotation(MyAnnotation.class);:
七月又过了三分之二卧槽,睡觉了
Annotation
原文:https://www.cnblogs.com/shilimaixiang/p/11223451.html