- Annotation类的定义方式:public @interface MyAnnotation {
- retention 分:SOURCE,CLASS,RUNTIME
- annotation type分:TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE,ANNOTATION_TYPE,PACKAGE
type是加在类上面的注释:spa

用的时候,直接在class上面注释就好了:注释是以annotation对象的形式存在的3d

获取注释对应属性值的方法:对象
ans的长度是2blog

不用new bird 这样就能够了:MyAnnotation bb=Bird.class.getAnnotation(MyAnnotation.class);:get


- 若是是annotation type 是method ,那么获取有注解的方法:

七月又过了三分之二卧槽,睡觉了io