本文是Spring系列文章的一部分。其他相关文章见
Spring系列文章导航
本文整理反射相关知识。
常用的类
java.lang.refect中的类
- Field 类的成员变量
- Method类方法
- Constructor构造器
- Array操作数组
基本数据类型也是有.class的
Class和Constructor都有newInstance()方法
但是Class还是要获取Constructor类,然后调用Constructor的newInstance()方法
私有变量或函数的访问
f.setAccessible(true);