日期:2014-05-20 浏览次数:20735 次
class Sup { public int i = 0; //public Sup(){} public Sup(String text) { i = 1; } } public class Sub extends Sup { public Sub(String text) { super(text); int i= 2; } public static void main(String args[]) { Sup sub = new Sub("Hello"); System.out.println(sub.i); } }
class Sup { public int i = 0; public Sup(){} public Sup(String text) { i = 1; } } public class Sub extends Sup { public Sub(String text) { //super(text); int i= 2; } public static void main(String args[]) { Sup sub = new Sub("Hello"); System.out.println(sub.i); } }