import java.lang.reflect.*;
class Fu {
public String name = null;
public int age = 0;
}
class Zi extends Fu {
public String school = "北京黑马";
public int money = 0;
public static void main(String args[]){
System.out.println("getFields方法:打印的是本类,父类,超类中的公共字段");
for(Field m :Zi.class.getFields())
System.out.println(m);
System.out.println("\t\t=========\n");
System.out.println("getDeclareFields方法:只能打印本类中的所有字段");
for(Field m :Zi.class.getDeclaredFields())
System.out.println(m.getName());
}
}