我的报错是field.get()中的参数填错了,参数Object应该填写对象
CDict c=new CDict();
Class aClass=c.getClass();
Field[] fields=aClass.getDeclaredFields();
for(Field f:fields){
//获取字段名
String name=f.getName();
//获取字段类型
Class<?> type=f.getType();
//获取属性对应的值,注意填写对象c
Object c=field.get(c);
}