[quote="//Example 1"]package sz.starbex.bill.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SimpleAnnotation {
String value();
}[/quote]
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SimpleAnnotation {
String value();
}[/quote]
本文介绍了一个简单的Java注解示例,定义了一个名为SimpleAnnotation的注解,该注解可以应用于方法级别,并携带一个字符串值。
6223

被折叠的 条评论
为什么被折叠?



