如何使用超级关键字访问超类的隐藏字段
class MySuper { protected int num = 100; protected String name = "Edith"; }/**来自 nowjava.com**/ class MySub extends MySuper { // Hides the num field in MySuper class private int num = 200; // Hides the name field in MySuper class private String name = "Mary"; public void print() { // MySub.num /* 来自 *n o w j a v a . c o m*/ System.out.println("num: " + num); // MySuper.num System.out.println("super.num: " + super.num); // MySub.name System.out.println("name: " + name); // MySuper.name System.out.println("super.name: " + super.name); } }