ImageVerifierCode 换一换
格式:DOC , 页数:13 ,大小:96.50KB ,
资源ID:3784644      下载积分:8 金币
验证码下载
登录下载
邮箱/手机:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/3784644.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  
声明  |  会员权益     获赠5币     写作写作

1、填表:    下载求助     留言反馈    退款申请
2、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
3、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
4、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
5、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
6、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
7、本文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。

注意事项

本文(软件学院-面向对象程序设计--2009(2)期末b卷复习进程.doc)为本站上传会员【快乐****生活】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4008-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

软件学院-面向对象程序设计--2009(2)期末b卷复习进程.doc

1、软件学院_面向对象程序设计_2008-2009(2)期末B卷精品文档一、 选择题(30分)说明:每题2分,只有1个正确答案,请将正确答案填写在下面表格中。题号123456789101112131415答案1 Which of the following statements is correct about Java packages?A.A package may contain unlimited number of nested sub-packages.B.A package is a collection of related Java source program.C.Using

2、the import statement can include all the classes into the current program from a specified package and its sub-packages.D.If there is no package statement used, the current class will not be in any package.2 Which one is the wrong statement about Java constructors?A.The name of a constructor must be

3、 the same as its classs name.B.A constructor has no return value and can not be modified by void.C.A constructor of the parent class can not be inherited by its sub-classes.D.All constructors must be modified by public.3 Giving the code bellow:class Test private int m; public static void fun() /* so

4、me code. */ How to make the member variable m accessible for method fun()?A.change private int m to protected int mB.change private int m to public int mC.change private int m to static int mD.change private int m to int m4 Which of the following functions is an overloading function of public void e

5、xample().?A.public void example().B.public int example().C.public void example2().D.public int example(int m, float f).5 In Java, a class may have many different methods with the same name. The number, type, sequences of arguments in these methods are different, and the return value can be different

6、 as well. What do we call this feature in terms of object-oriented programming?A.HidingB.OverridingC.OverloadingD.This feature is not supported in Java6 How to execute the following program?public class Test public static void main(String args) System.out.println(args0); A.java Test.classB.java Test

7、C.java Test aStringD.javac Test7 If a container has been resized, which of the following layout manager did not change the internal components size?A.CardLayoutB.FlowLayoutC.BorderLayoutD.GridLayout8 Which is the right statement about exception handling?A.In java, all exceptions are necessary to be

8、caught and handled.B.The “catch” statement catches exception by type-matching.C.In the “try-catch-finally” structure, the program will exit after exception handling.D.Exception is a kind of errors, and it should be absolutely avoided in programs.9 The following statements are about type-casting, whi

9、ch one is correct?A.A reference variable of a class can only be assigned to an object of its first level sub-classes of this class.B.An object can not be casted to the type of another class which has no inheritance relationship with the objects original class.C.A child classs reference variable can

10、be assigned to an object of its parent class.D.There is only explicit casting, but no implicit casting.10 Both class Teacher and Student are the sub-classes of Person.Person p; Teacher t; Student s; / assume p, t and s are not nullif(t instanceof Person) s = (Student)t; Which statement about the las

11、t line of expression is correct?A.A new Student object will be created.B.The type-casting is correct.C.The expression is incorrect.D.There is no syntax error but will generate runtime error.11 According to the code below, which statement is correct?public class Test static Object o; public static vo

12、id main(String args) System.out.println(o); A.Generates compile error.B.Compiles OK, but has runtime errors.C.Outputs zero.D.Outputs “null”.12 According to the code below, select the statement which is false.String s = Hello;String s1 = new String(Hello);String s2 = s1.intern();String s3 = Hello;A.s

13、1 = sB.s2 = sC.s = s3D.s2 = s313 The array definition code is given below, which statement is correct?String s = new String10;A.The definition of array s is illegal in syntax.B.s is a 1010 two-dimensional array.C.All elements in s are .D.s is an array of ten arrays.14 Which is the correct output acc

14、ording to the program given bellow?public static void main(String args) Scanner scanner = new Scanner(this is one that is two); scanner.useDelimiter( is); / there is a space before is while(scanner.hasNext() System.out.print(scanner.next(); A.this one that twoB.th one that twoC.thone that twoD.this

15、is one that is two15 The file “empty.txt” does not exist before, what its content will be after executing the following code.public static void main(String args) throws FileNotFoundException PrintWriter pr = new PrintWriter(new File(empty.txt); pr.print(onettwo); pr.append(n1t2); pr.close();A.one tw

16、oB.onettwo1 21t2C.onettwon1t2D.one two 1 2二、 改错题(20分)说明:写出每段代码的错误原因并改正错误,每小题4分,说明原因和改正各2分。1 class First import java.io.*;package mypackage;class Second 2 class A String name; public A(String s) name = s; class B extends A int id; public B (int i) id = i; 3 class Alpha private void m() public void p(

17、) class Beta extends Alpha public void m() private void p() 4 interface Base void m(); void n();class Child implements Base public void m() System.out.println(this is method m); 5 public class B extends A final void increase() value += 2; class A int value = 0; final void increase() value += 1; 三、 程

18、序阅读题(20分)说明:阅读下面程序并写出它们的输出结果,每小题5分。1 The program is as below:class A int h = 1; public A(int h) h = h; System.out.println(this.h); this.h = h; System.out.println(this.h); public static void main(String args) A a = new A(2); 2 The program is as below:class Base public Base() System.out.println(What a

19、 pleasure!); public Base(String s) this(); System.out.println(I am + s + !); public class Child extends Base public static void main(String args) Child t = new Child(Mike); public Child(String s) super(s); System.out.println(How do you do?); public Child() this(I am Tom); 3 The program is as below:c

20、lass DivTest public static void main(String args) int r, n, d; n = 10; d = 0; try r = n / d; System.out.println(r= + r); catch(ArithmeticException e) System.out.println(Divide 0 exception!); finally System.out.println(Calculation complete!); System.out.println(Program finish!); 4 Analyze the program

21、 bellow, and explain its effect.public class MyFrame extends JFrame JButton b1, b2; public MyFrame() ActionListener a = new ActionListener() public void actionPerformed(ActionEvent evt) if (evt.getSource() = b1) b1.setEnabled(false); b2.setEnabled(true); else b1.setEnabled(true); b2.setEnabled(false

22、); ; setLayout(new FlowLayout(); b1 = new JButton(1); b1.addActionListener(a); add(b1); b2 = new JButton(2); b2.addActionListener(a); add(b2); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(150, 100); setVisible(true); public static void main(String args) new MyFrame(); 四、 应用设计题(6分)The foll

23、owing classes are a part of the classes founded in a companys personnel management system, find out their relationships and illustrate using a UML class diagram.Employee, long-tern employee, temporal employee, manager, temporal salesman.五、 程序设计题(24分)说明:按照题目要求编写下面两段程序。1 Write a java application progr

24、am containing these classes: Person, Student, TestStudent. The details are:Class PersonPropertiesname: Stringsex: charid: Stringphone: Stringemail: String MethodsPerson(Name name, char sex, String id): constructorString getId()void setEmail(String email)void setPhone(String phone)String toString():

25、outputs a persons informationClass StudentA sub-class derived from Person, more properties are added:PropertiessNo: longsClass: StringMethodsStudent(long sNo, String name, char sex, String id): constructorsetClass(String sClass)String toString(): outputs a students informationClass TestStudentA clas

26、s used as the main class to test the functions.use the following information to create a student object, aStudent.Name: Guo Yang Sex: male ID: 22033198807070333 sNo.: 2004002 set other information to aStudent.E-mail: yangguo Phone: 88078549 output all the information of aStudent.2 Calculate the sum

27、area of circles. (14 points)The requirements are: Define an interface Shape, and a no-arg method getArea() that returns double value. Define a class Circle implementing the Shape interface above, within the class there is a double property radius and two constructors. One of the constructors has no

28、argument and it sets the radius to zero; another constructor sets the radius by using the argument provided, or sets radius to zero when the argument is less than zero. Write a class Test containing the main method that converts each command-line argument to double values, and create Circle objects

29、according to the double values converted. Exception handling should be provided on conversing the command-line arguments. If an error occurred, print an error message and create the Circle using the default constructor. Finally, calculate and output the sum area of all the Circles.收集于网络,如有侵权请联系管理员删除

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服