@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/07/05 17:11:40
![@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](/uploads/image/z/12760385-41-5.jpg?t=%40Retention%E5%89%8D%E9%9D%A2%E5%8A%A0%E4%B8%AA%40%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9Dpackage+javax.annotation%3Bimport+java.lang.annotation.ElementType%3Bimport+java.lang.annotation.Retention%3Bimport+java.lang.annotation.RetentionPolicy%3Bimport+java.lang.annotation.Target%3B%40Target%28%7BElementType.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.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新增语法:注解