
资料内容:
1.创建自定义注解 
1. /** 
2. * 自定义注解例子 
3. * 
4. * @author mikechen 
5. */ 
6. 
7. @Documented 
8. @Retention(RetentionPolicy.RUNTIME) 
9. @Target(ElementType.METHOD) 
10. @Inherited 
11. public @interface HelloAnnotation { 
12. String value(); 
13. } 
2.使用自定义注解 
1. /* 
2. * 使用自定义注解 
3. * 
4. * @author mikechen 
5. */ 
6. public class HelloAnnotationClient { 
7. @HelloAnnotation(value="Simple custom Annotation example") 
8. public void sayHello(){ 
9. System.out.println("Inside sayHello method.."); 
10. } 
11. }
 
                