关于使用 super 和 父类名调用父类成员的区别 super 的用法分为两种 (一般在有继承关系的时候才会用):父类名调用成员用法:一下举个例子 super 的用法分为两种 (一般在有继承关系的时候才会用): 调用父类中被重写或被隐藏的成员,(也可以访问非隐藏或重写的成员); class F { public void display(){ System.out.println(" Father "); } } class S extends F { public void display(){ super.display(); } } 调用父类构造器; 父类名调用成员用法: 子类只能用父类名调用父类 static 成员;在非继承关系时可以使用; 一下举个例子 //父类 public class Atext { public void show() { System.out.println("non-static Show() "); } public static void print() { System.out.println("static print() "); } } //子类 class D extends Atext { public void show() { super.show(); //调用父类 non-static成员 super.print(); //调用父类 static成员 Atext.show(); //调用父类 non-static成员 错误 错误 错误 Atext.print(); //调用父类 static成员 } } //非子类 class E { public void run() { Atext.print(); //调用父类 static成员 Atext.show(); //调用父类 non-static成员 错误 错误 错误 } }