随笔分类 -  java.reflect

java反射
摘要:反射的使用 拿到此类的接口/包/注解 import java.lang.annotation.Annotation; @Deprecated public class demo6 implements Runnable { @Override public void run() { } public 阅读全文
posted @ 2022-03-09 10:00 CoderCatIce 阅读(32) 评论(0) 推荐(0)
摘要:所有类型的Class /* * 所有类型的Class * */ import java.lang.annotation.ElementType; public class ClassDemo { public static void main(String[] args) { // 类的Class 阅读全文
posted @ 2022-02-15 21:15 CoderCatIce 阅读(52) 评论(0) 推荐(0)
摘要:reflection(反射)得到Class对象的方法 反射得到Class对象的基础使用 一个类在内存中只有一个Class对象 一个类被加载后,类的整个结构都会被封装在Class对象中 public class Demo { public static void main(String[] args) 阅读全文
posted @ 2022-02-15 19:54 CoderCatIce 阅读(87) 评论(0) 推荐(0)