程序分析: public class Base { String var="基类变量"; static String staticVar="基类静态变量"; void method() { System.out.println("基类方法"); } static void staticMethod() { System.out.println("基类静态方法"); } } public class Sub extends Base{ String var="子类变量"; static String staticVar="子类静态变量"; void method() { System.out.println("子类方法"); } static void staticMethod() { System.out.println("子类静态方法"); } String subVar="变量只属于子类"; void subMethod() { System.out.println("方法只属于子类"); } public static void main(String[] args) { Base who=new Sub(); System.out.println(“who.var=”+who.var); System.out.println("who.staticVar="+who.staticVar); who.method(); who.staticMethod();} }