class Father{
public int num=10;
}
class Sun extends Father{
public int num=20;
public void show(){
int num=30;
System.out.println(num);
System.out.println(this.num);
System.out.println(super.num);
}
}
public class Extends1 {
public static void main(String[] args){
Sun s=new Sun();
s.show();
}
}
程序运行结果为:
30
20
10