若執行下列的 Java 程式碼,則螢幕上輸出的英文字母依序為何? class Parent{ Parent(){ System.out.println('p'); } } class Child extends Parent{ Child(){ System.out.println('c'); } } public class ClassTest{ public static void main(String[] args){ Parent p = new Parent(); Child c = new Child(); Parent x = new Child(); } }
Ap,c,c
Bp,c,p
Cp,p,c,p
Dp,p,c,p,c正確答案
答案與詳解
