ImageVerifierCode 换一换
格式:DOC , 页数:9 ,大小:128.50KB ,
资源ID:9396668      下载积分:10 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

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

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

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

注意事项

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

面向对象程序设计A(JAVA)B.doc

1、 班 级 学 号 姓 名 密封装订线 密封装订线 密封装订线 XX大学2008-2009学年第(一)学期考试试卷 课程代码 课程名称 面向对象程序设计A(JAVA)考试时间 120分钟 题号 一 二 三 四 五 总成绩 得分 阅卷教师签

2、字: B卷 注意事项: 1. 答题前,请先在试卷和机读卡上对应位置用钢笔准确清楚的填写上本人姓名和学号,机读卡的科目栏里填写年级和专业的简称,并用2B铅笔填涂学号(必须填在前8列,剩最右边的一列不填涂); 2. 试卷答案必须用2B铅笔在机读卡上按对应题号准确、清楚涂写,答在试卷上无效;  本试卷共65个小题,1~60小题填写在机读卡上,按【1】~【60】的编号顺序涂写。61~65题做在答题卷上。【1】~【40】每题1分,【41】~【60】每题2分。【61】~【65

3、每题4分,做在答题卷上,共100分。 一、判断题(本大题共10小题,每小题1分,共10分,正确的填A,错误的填B) 1. 数组、类和接口都是引用数据类型。 2. Java语言中一个char类型的数据占用2个字节大小的内存空间。 3. 编译语句Double aDouble = 33.5D; 时不会出现编译错误。 4. 程序中抛出异常时(throw…),只能抛出自己定义的异常对象。 5. 所有的文件输入/输出流都继承于InputStream类/OutputStream类。 6. 一个异常处理中的finally语句可以有多个。 7. Applet程序不能单独运行,需要嵌入在HTM

4、L文件中,借助浏览器来解释执行。 8. Java语言在设计C/S程序时,应注意在服务器端使用Socket类来处理客户端的连接请求。 9. 数组是用来存放一批相同类型的对象或数据,当数据的顺序和个数经常发生变动时就要用到向量来存放。 10. 构造函数不能被重载。 二、单项选择题(本大题共30小题,每小题1分,共30分)    在每小题列出的四个选项中,只有一个是符合题目要求的,请将其代码填在后面的答题卷上。错选或未选均无分。   11. 下列哪个属于容器的构件?   A)JFrame B)JButton C)JPnel D)JApplet   12. 如果希望所有的控件在界

5、面上均匀排列,应使用下列那种布局管理器? A)BoxLayout B)GridLayout C)BorderLayout D)FlowLouLayout 13. Java语言具有许多优点和特点,下列选项中,哪个反映了Java程序并行机制的特点?   A)安全性  B)多线性  C)跨平台  D)可移植   14. 下列叙述中,错误的是 A)Java Application与Applet所用编译命令相同 B)通常情况下Java Application只能有一个main( )方法 C)Java Applet 必须有HTML文件才能运行 D)Java Applet程

6、序的class文件可用java命令运行 15. 下列事件监听器中,无法对TextField 对象进行事件监听和处理的是 A)ActionListener B)FacusListener C)MouseMotionListener D)ChangeListener 16. 下列关于Applet的安全限制 叙述中,错误的是 A)通常情况下,禁止Applet读写本地文件系统 B)通常情况下,禁止Applet向Applet源主机之外的任何主机建立网络连接 C)通常情况下,禁止Applet读取系统信息 D)通常情况下,禁止Applet加载本地库或方法 17. 下

7、列标识符(名字)命名原则中,正确的是 A)类名的首字母小写 B)变量和方法名的首写字母大写 C)接口名的首写字母小写 D)常量完全大写 18. 作为Java应用程序图形界面基础的是___。 A)Panel B)Frame C)Windows D)Applet 19. Java不允许多重继承,而利用____的设计来达到多重继承的目的。 A)类   B)接口   C)对象 D)方法 20. 下列哪个选项是合法的标识符? A)123 B)_name C)class D)1first 21. 下列关于for循环和while循环的说法中哪个是正

8、确的?   A)while循环能实现的操作,for循环也都能实现     B)while循环判断条件一般是程序结果,for循环判断条件一般是非程序结果     C)两种循环任何时候都可替换     D)两种循环结构中都必须有循环体,循环体不能为空  22. 下列关于Java语言特点的叙述中,错误的是 A)Java是面向过程的编程语言 B)Java支持分布式计算 C)Java是跨平台的编程语言 D)Java支持多线程 23. 下列的哪个赋值语句是不正确的? A)float f = 11.1; B)double d = 5.3E12; C)float d =

9、3.14f ; D)double f=11.1E10f; 24. 下列的哪个赋值语句是正确的? A)char a=12; B)int a=12.0; C)int a=12.0f; D)int a=(int)12.0; 25. 下列哪个修饰符可以使在一个类中定义的成员变量只能被同一包中的类访问? A)private B)无修饰符 C)public D)protected 26. 在Applet的关键方法中,下列哪个方法是关闭浏览器以释放Applet占用的所有资源? A)init( ) B)start( ) C)paint( ) D)destro

10、y( ) 27. 给出下列代码,则数组初始化中哪项是不正确的? byte[] array1,array2[]; byte array3[][]; byte [][] array4; A)array2 = array1 B)array2=array3 C)array2=array4 D)array3=array4 28. 下列关于内部类的说法不正确的是 A)内部类的类名只能在定义它的类或程序段中或在表达式内部匿名使用 B)内部类可以使用它所在类的静态成员变量和实例成员变量 C)内部类不可以用abstract修饰符定义为抽象类 D)内部类可作为其

11、他类的成员,而且可访问它所在类的成员 29. 顺序执行下列程序语句后,则b的值是 String a="Hello"; String b=a.substring(0,2); A)Hello B)hello C)Hel D)null 30. 下列常见的系统定义的异常中,哪个是输入、输出异常? A)ClassNotFoundException B)IOException C)FileNotFoundException D)UnknownHostException 31. 下列哪个选项是正确计算42度(角度)的余弦值? A)double d=Mat

12、h.cos(42); B)double d=Math.cosine(42); C)double d=Math.cos(Math.toRadians(42)); D)double d=Math.cos(Math.toDegrees(42)); 32. Which is Java keyword?    A)math    B)null    C)FALSE    D)TRUE 33. Which is the range of int type?    A)-216~216-1    B)- 231~231-1    C)-232~232-1    D)-264~

13、264-1 34. FilterOutputStream is the parent class for BufferedOutputStream, DataOutputStream and PrintStream. Which classes are valid argument for the constructor of a FilterOutputStream?    A)InputStream    B)OutputStream    C)File    D)RandomAccessFile 35. Which of the following are valid dec

14、larations? A) char c= ' \' ' B) char c= "cafe" C) char c= '0xfg' D) char c="\xef" 36. Which statement about the garbage collection mechanism are true?   A)Garbage collection require additional programe code in cases where multiple  threads are running.   B)The garbage collection system nev

15、er reclaims memory from objects while are still accessible to running user threads.   C)The programmer has a mechanism that explicity and immediately frees the memory used by Java objects.   D)The garbage collection mechanism can free the memory used by Java Object at explection time. 37. Whic

16、h of the following is true of anonymous innerclass? A) Anonymous inner class can be declared as private,protected or public. B) Anonymous inner class can implement multiple interfaces. C) if not extended or implemented, an anonymous innerclass can become immediate subclass of the outer class or i

17、mplement an interface. D) if not extended or implemented, an anonymous inner class can become immediate subclass of outer class or implement mutiple interfaces. 38. Which statement is true about an inner class?    A)It must be anonymous    B)It can’t implement an interface    C)It is only ac

18、cessible in the enclosing class    D)It can access any final variables in any enclosing scope. 39. Which is the main() method return of a application?   A)String   B)byte   C)char   D)void 40. Which is corrected argument of main() method of application?   A)String args   B)String args[]   

19、C)Char args[][]   D)StringBuffer arg[] 三、单项选择题(本大题共20小题,每小题2分,共40分)    在每小题列出的四个选项中,只有一个是符合题目要求的,请将其代码填在后面的答题卷上。错选或未选均无分。 41. 阅读下面代码 if(x==0) { System.out.println(“冠军”); } else if(x>-3) { System.out .println(“季军”); } 若要求打印字符串“季军”,则变量X的取值范围是 A)x!=0&&x>-3   B)x=0   C)x>-3||x!=0   D)x<=-3

20、 42. 假设Foo类有如下定义,设f是Foo类的一个实例,下列语句调用哪个是错误的? public class Foo{ int i; static String s; void imethod(){ } static void smethod(){ } } A)Foo.imethod(); B)f.imethod(); C)System.out.println(f.i); D)Foo.smethod(); 43. 给出下列代码,如何使成员变量m 被方法fun()直接访问? class Test { priva

21、te int m; public static void fun( ) { ... } } A)将private int m 改为protected int m B)将private int m 改为 public int m C)将private int m 改为 static int m D)将private int m 改为 int m 44. 以下程序运行后的输出结果是: class StaticStuff{ static int x; static {x+=5;} public static void main(String[] ar

22、gs){ System.out.println("x="+x); } static {x%=3;} } A)x=0 B)x=5 C)x=3 D)x=2 45. 阅读下面程序 import java.*; public class TypeTransition{ public static void main(String args[]){ char a='E'; int m=100; int j=97; int aa=a+m; System.out.println("aa="+aa); char bb=(char)

23、j; System.out.println("bb="+bb); } } 如果输出结果的第二行为bb=a,那么第一行的输出是 A)aa=100 B)aa=169 C)aa=97 D)aa=69 46. 下列哪个选项的java源文件代码片段是不正确的? A)package testpackage; B)import java.io.*; public class Test{ } package testpackage; public class Test{ } C)import java.io.*; D) impo

24、rt java.io.*; class Person{ } import java.awt.*; public class Test{ } public class Test{ } 47. Given the following class definition:   class A{   protected int i;   A(int i){   this.i=i;   }   }   which of the following would be a valid inner class for this class?   A)cla

25、ss B{ }    B)class B extends A{ }   C)class B extends A{ D)class B{    B(){System.out.println(“i=” i);} class A{ }    } 48. public class Happy { public static void main(String args[]) { int i=4; int j=2; methodA(i,j); System.ou

26、t.println(i); } static public void methodA(int i,int j) { i<<=j; } } A) compilation error B) 16 C) 64 D) 4 } 49. Give the following java source fragment:   //point x   public class Interesting{   //do something   }   Which statement is correct

27、ly Java syntax at point x?   A)import java.awt.*;   B)package mypackage   C)static int PI=3.14   D)public class MyClass{//do other thing…} 50. Give the following java class:    public class Example{    static int x[]=new int[15];    public static void main(String args[]){    System.o

28、ut.println(x[5]);    }    }    Which statement is corrected?    A)When compile, some error will occur.    B)When run, some error will occur.    C)Output is zero.   D)Output is null. 51. What is written to the standard output given the following statement:    System.out.println(4&

29、7);    Select the right answer:    A)4    B)5    C)6    D)7 52. What is written to the standard output given the following statement:    System.out.println(7|9);    Select the right answer:    A)0    B)7    C)9    D)15 53. Look the inheritance relation:    person man woman

30、    In a source of java have the following line:    woman w=new man():    What statement are corrected?    A)The expression is illegal.    B)Compile corrected but running wrong.    C)The expression is legal.    D)Will construct a woman object. 54. Which can NOT be used in declaring o

31、r declaring and initializing an automatic (method local) variable?    A)final    B)static     C)expressions    D)Constants of non-primitive type 55. Which statements is true about Listeners?    A)At most one listener can be added to any simple Component.    B)The return value from a listene

32、r is used to control the invocation of other listener    C)If multiple listeners are added to a single component, they must all be made friends to each other    D)If multiple listeners are added to single component, the order of invocation of the listener is not specifieD) 56. Float s=new Float

33、0.9F);   Float t=new Float(0.9F);   Double u=new Double(0.9);   Which expression’s result is true?   A)s!=t   B)s.equals(t)   C)s==u   D) t.equals(u) 57. Give the following method:   1) public void method( ){   2) String x,y;   3) x=new String(“hello world”);   4) y=new

34、String(“game over”);   5) System.out.println(x+y+“ok”);   6) x=null;   7) x=y;   8) System.out.println(x);   9) }   In the absence of compiler optimization, which is the earliest point the object x refered is definitely elibile to be garbage collection.   A)before line 5   B)bef

35、ore line 6   C)before line 7   D)Before line 9 58. Given the following class outline:    class Example{    private int x;    // rest of class body    public static void main(String args[]){    //implementation of main method }    }    Which statement is true?    A)x=2 is a vali

36、d assignment in the main() method of class Example.    B)Changing private int x to static int x would make x=2 a valid assignment in the main() method of class Example.    C)Changing private int x to public int x would make x=2 a valid assignment in the main() method of class Example.    D)Cha

37、nging private int x to int x would make x=2 a valid assignment in the main() method of class Example. 59. Give following programe: class EX{ public static void main(String args[]){ outer: for(int i=0; i<3; i++ ) inner: for(int j=0; j<3; j ++){ if(j>=1) break outer;

38、 System.out.println(j +" and "+ i); } }}    Which will be output?    A)0 and 0 B)0 and 1 C)0 and 2 D)0 and 3 60. What will be the result of attempting to compile and run the following code? abstract class MineBase{ abstract void amethod(); static int i; } public cl

39、ass Mine extends MineBase{ public static void main(String args[]){ int[] ar = new int[5]; for(i=0; i

40、utOfBoundes Error 四、阅读以下程序,写出运行结果或功能(本大题共5小题,每小题4分,共20分) 61. import java.io.*; public class Test1{ public static void main(String[] args){ Loop: for(int i=1;i<15;i++) {if(i%3!=0) continue Loop; System.out.printf(i+" "); } } }  What will be the output? 3 6 9 12 62

41、. import java.io.*; public class Test{ public static void main(String args[]){ String s1 = "Hi!"; String s2 = new String("How are you!"); System.out.println(s1+" "+s2); } }  What will be the output? Hi! How are you! 63. class Rock { Rock() { System.out.println("Creat

42、ing Rock"); } } public class SimpleConstructor { public static void main(String[] args) { new Rock(); } }  What will be the output? Creating Rock 64. import java.io.*; class MyException extends Exception{ public String toString(){ return "negative number"; } } publ

43、ic class ExceptionDemo{ public static void mySqrt(int a) throws MyException{ if(a<0) throw new MyException(); System.out.println(Math.sqrt(a)); } public static void main(String args[]){ try{ mySqrt(16); mySqrt(-16); }catch(MyException e){ System.out.println("Exception:"+e);

44、 } } } What will be the output? 4.0 Exception:negative number 65. 写出以下程序的功能 import java.io.*; public class Reverse{ public static void main(String args[]){ int i,n=10; int a[] = new int[10]; for(i=0;i=0;i--) System.out.print(a[i]+" "); System.out.println(); } } 从键盘上输入10个整数,再按输入时的逆序在显示器上输出。 第 9 页 共 9 页(B卷)

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

关于我们      便捷服务       自信AI       AI导航        抽奖活动

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

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

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

关注我们 :微信公众号    抖音    微博    LOFTER 

客服