Java進階知識-反射

獲取Class對象 有三種方式獲取Class對象:java 根據類的完整包名獲取Class Class clazz = Class.forName("com.example.xjp.demo.reflect.PersonInfo"); 根據類名直接獲取Class Class clazz = PersonInfo.class; 根據實例類的對象獲取Class PersonInfo personInf
相關文章
相關標籤/搜索