题海让大学四年没有难题
白天模式登陆

题目详情

单选题 以下程序运行结果是( ). class FatherX{ public Integer getX() { return new Integer(10); }}class Son extends FatherX{ public Double getX() { return new Double(20); }}public class Demo12 { public static void main(String[] args) { FatherX f=new FatherX(); Son s=new Son(); System.out.println(f.getX()+s.getX()); }}

A. 30

B. 30.0

C. 30.000

D. 编译失败

面相对象程序设计(Java)课程封面

学科:面相对象程序设计(Java)

时间:2024-11-09 14:00:11

Copyright © 2022 津ICP备2021001502号