获取成员方法

Method[ ] getMethods()
* Method getMethod(String name,类<?>…parameterTypes)

* Method[ ] getDeclaredMethods()
* Method getDeclaredMethod(String name,类<?>...parameterTypes)
1
2
4,获取类名
* string getName()

Field:成员变量
操作:
1,设置值

void set(Object obj,Object value)
2,获取值

get(Object obj)
3,忽略访问权限修饰符的安全检查

setAccessible(true):暴力反射

原文地址:https://www.cnblogs.com/hyhy904/p/11436103.html