日期:2014-05-20 浏览次数:20727 次
public class Base { public String str = "base"; public void print() { System.out.println(str); } }
public class Sub extends Base { public String str = "sub"; public void myPrint() { super.print(); } }
public class Base { public String str = "base"; public void print() { System.out.println(getStr()); } public String getStr() { return str; } } public class Sub extends Base { public String str = "sub"; public void myPrint() { super.print(); } public String getStr() { return str; } }