标签:
public class B extends P { int a = 33; public B() { System.out.println("B" + a); a = 44; diplay(); } @Override public void diplay() { System.out.println("I am in B, value is " + a); } } public class P { public int a = 11; public P() { System.out.println("P " + a); a = 22; diplay(); } public void diplay() { System.out.println("I am in P, value is " + a); } } public class Test { public static void main(String[] args) { B b = new B(); System.out.println(b.a); } }
标签:
原文地址:http://www.cnblogs.com/yujinghui/p/5698844.html