手机扫码访问

导航
您当前的位置:首页 > 计算机 > IT技能
问题:

[单选题]13. 下面是People和Child类的定义,每个构造方法都输出编号。在执行new Child("c")时,程序的运 行结果是______。
class People{
String name;
public People() {System.out.print(1);}
public People(String name){
System.out.print(2);
this.name=name;
}
}
class Child extends People{
People father;
public Child(String flame){
System.out.print(3);
this.name=name;
father=new People(name+":F");
}
public Child() {System.out.print(4);}
}
A.312
B.32
C.432
D.132
 
答案解析:

相关问题
关于我们 | 用户指南 | 版权声明 | 给我留言 | 联系我们 | 积分商城 | 答案求助 | 网站地图
Copyright © 2020 www.daanwo.com All Rights Reserved