模拟试题2-参考答案(3页).doc

上传人:1595****071 文档编号:37296537 上传时间:2022-08-30 格式:DOC 页数:3 大小:169.50KB
返回 下载 相关 举报
模拟试题2-参考答案(3页).doc_第1页
第1页 / 共3页
模拟试题2-参考答案(3页).doc_第2页
第2页 / 共3页
点击查看更多>>
资源描述

《模拟试题2-参考答案(3页).doc》由会员分享,可在线阅读,更多相关《模拟试题2-参考答案(3页).doc(3页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、-模拟试题2-参考答案-第 - 3 - 页Java语言程序设计模拟试题二答案一、选择题(152分)题号12345678910答案BA CC BBCADC题号11121314151617181920答案ABDBDCADDA二、填空题:共10小题,共20空 ,每空1分 ,满分20分;请将答案填入横线上。1max=xy?x:y;)2(long var=10000000000L;或long var=(long)1e10;)3(float 32位、double 64位)4顺序结构 、选择结构、循环结构5(return a*b)687属性8(属性、方法、类)9(类、方法)10继承、封装、多态三、程序阅读题

2、:共5小题,满分20分。 1(i j k l) (i j)2 B b=new B(10,A);b.show();3Hello, Java world!Hello, students! 4 (张山;30;3800.0)(2)5 no jobkids should not work四、程序填空题:共5小题,每小题4分,满分20分。1 0 continue 2 Myclass int j3 max(i1,i2,i3)static4 interface abstract 5 Applet或JApplet,drawString五、程序设计题:满分20分。【问题一】 5分abstract class Pe

3、rson private String name; public Person(String n) name = n; public abstract String getDescription(); public String getName() return name;【问题二】 5分class Employee extends Personprivate double salary; public Employee(String name, double salary) super(name); this.salary = salary; public double getSalary(

4、) return salary; public String getDescription() return an employee with a salary of + salary; public void raiseSalary(double byPercent) double raise = salary * byPercent / 100; salary += raise;【问题三】 5分class Student extends Personprivate String major; public Student(String name, String major) super(n

5、ame); this.major = major; public String getDescription() return a student majoring in + major;【问题四】 5分public class PersonTest public static void main(String args) Person people = new Person2;/定义一个Person数组:people; /向数组people中加入Student和Employee对象 people0= new Employee(Harry Hacker, 50000); people1= new Student(Maria Morris, computer science); for(int i=0;ipeople.length;i+) System.out.println(peoplei.getName() + , + peoplei.getDescription();

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 单元课程

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com