看板 b94902HW 關於我們 聯絡資訊
我試了一下 執行java test 結果是: this is A int x this is B int x this is B class A{ A(int x){ System.out.println("this is A int x"); } A(){ System.out.println("this is A"); } } class B extends A{ int t=3; B(){ this(0); System.out.println("this is B"); } B(int x){ super(x); System.out.println("this is B int x"); } } class test{ public static void main(String[] s){ B b=new B(); } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.203.49.63 ※ 編輯: luyota 來自: 210.203.49.63 (04/25 00:04)
luyota:修文過後才是對的XD 04/25 00:04
dongogo:3Q~ 04/25 00:11