@Retention前面加个@是什么意思package javax.annotation;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.ANNOTATIO

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 04:32:18

@Retention前面加个@是什么意思package javax.annotation;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.ANNOTATIO
@Retention前面加个@是什么意思
package javax.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.ANNOTATION_TYPE,ElementType.CONSTRUCTOR,
ElementType.FIELD,ElementType.LOCAL_VARIABLE,ElementType.METHOD,
ElementType.PACKAGE,ElementType.PARAMETER,ElementType.TYPE})
,(RetentionPolicy.SOURCE)
public @interface Generated {
public String[] value();
public String date() default "";
public String comment() default "";
}
@Target,@interface @Retention这样前面加个@是什么意思呢,我在学J2SE的时候都没见过这样的写法,是什么书上教的,还有其他这样的写法吗?
没有分了,

@Retention前面加个@是什么意思package javax.annotation;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.ANNOTATIO
jdk 1.5新增语法:注解