1 class Fu { 2 int num = 5; 3 } 4 5 class Zi extends Fu { 6 //int num = 4; 7 void show(){ 8 System.out.println(this.num);//注意看这,子类的方法 9 } 10 } 11 12 public class zihefu { 13 14 public static void main(String[] args) { 15 Zi z = new Zi(); 16 z.show(); 17 System.out.println(z.num + "....." + z.num); 18 19 } 20 }