getDeclaredField是可以获取一个类的所有字段. getField只能获取类的public 字段. 转载于:https://www.cnblogs.com/zzw3014/p/9831562.html