注解与反射

注解@Interface @Retention 注解能够保留多长时间: RetentionPolicy.SOURCE:Annotation只保留在源代码中,编译器编译时,直接丢弃这种Annotation。 RetentionPolicy.CLASS:编译器把Annotation记录在class文件中。当运行Java程序时,JVM中再也不保留该Annotation。 RetentionPolicy.
相关文章
相关标签/搜索