题目:阅读以下程序,给出程序的输出结果。publicclassFather {String name, address, tel;intage;publicFather(String name, intage) {this.name= name;this.age= age;}voidout() {System.out.print("姓名:"+ name);System.out.print(" 年龄:"+ age);}voidoutOther() {System.out.print(" 家庭住址:"+ address);System.out.print(" 电话:"+ tel);}}classSon extendsFather {String school;publicSon(String name, intage) {super(name, age);}voidout() {super.out();super.outOther();System.out.println(" 学校:"+ school);}publicstaticvoidmain(String args[]) {Son son = newSon("Tom", 15);son.address= "金水区";son.school= "九中";son.tel= "66123456";son.out();}}
答案:
<查看本题扣3积分>
姓名TOM
年龄 15
家庭住址 金水区..... 查看答案
问题答案不对?抱歉,搜索引擎优化导致页面变化,请尝试站内搜索,远程教育试题库