問題27 鑑於:本超級關鍵字如何在這個例子中工作?
class X {
X() {
System.out.print(1);
}
X(int x) {
this();
System.out.print(2);
}
}
public class Y extends X {
Y() {
super(6);
System.out.print(3); }
Y(int y) {
this();
System.out.println(4);
}
public static void main(String[] a) {
new Y(5);
}
}
ANS是1234有人可以解釋我怎麼樣?
這是哪一種語言? –
這是功課嗎? –
不,我正在學習JAVA。 如果這是作業,我不會提到答案。 – Gaurav