欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx

    • 资源ID:69336757       资源大小:16.90KB        全文页数:5页
    • 资源格式: DOCX        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx

    Oava语言程序设计模拟试卷A(考试时间90分钟 总分100分)一、选择题(每题2.5分,共50分)1. Which of the following range of short is correct?A,-27- 27-lB.0-216-1C. 215-215-lD. 231 - 23I-12. Which declarations of identifiers are legal?A. $personsTwoUsers*pointthisB. _endline3. Which statement of assigning a long type variable to a hexadecimal value is correct?A. long number = 345L;long number = 0345;long number = 0345L;long number = 0x345L4. Which of the following fragments might cause errors?A. String s = "Gone with the wind*;String t = " good ”;String k = s + t;String s = "Gone with the wind'1;String t;t = s3 + "one”;String s = "Gone with the wind'*;String standard = s.toUpperCase();B. String s = nhome directory*'String t = s - "directory"5. Which are syntactically valid statement at/ point x?class Person private int a;public int change(int m) return m; )public class Teacher extends Person public int b;public static void main(String arg )Person p = new Person();Teacher t = new Teacher();int i;/ point x)A. i = m;B. i = b;C. i = p.a;D. i = p.change(30);E. i = t.b.6. Given the following code fragment:1) public void create() 2) Vector myVect;3) myVect = new Vector();4)Which of the following statements are true?A. The declaration on line 2 does not allocate memory space for the variable myVect.B. The declaration on line 2 allocates memory space for a reference to a Vector object.C. The statement on line 2 creates an object of class Vector.D. The statement on line 3 creates an object of class Vector.E. The statement on line 3 allocates memory space for an object of class VectorWhich are not Java keywords?A. TRUEB. sizeofC. constD.superE. voidWhich of the following statements are true?A. The equals() method determines if reference values refer to the same object.B. The = operator determines if the contents and type of two separate objects match.C. The equals() method returns true only when the contents of two objects match.D. The class File overrides equals() to return true if the contents and type of two separate objects match.7. Which statements about inheritance are true?A. In Java programming language only allows single inheritance.B. In Java programming language allows a class to implement only one interface.C. In Java programming language a class cannot extend a class and implement a interface together.D. In Java programming language single inheritance makes code more reliable.8.1) class Person 2) public void printValue(int i, int j) /*/ 3) public void printValue(int i)/*.*/ 4)5) public class Teacher extends Person 6) public void printValue。/*.*/ )7) public void printValue(int i) /*.*/8) public static void main(String args )9) Person t = new Teacher();10) t.printValue(lO);11)12)Which method will the statement on line 10 call?11) on line 212) on line 313) on line 614) on line 7Which are not Java primitive types?A. shortB. BooleanC. unitD. floatWhich keyword should be used to enable interaction with the lock of an object? The flag allows exclusive access to that object.A. transientB. synchronizedC. serializeD. staticWhich is the return type of the method main()?A. intB. voidC. booleanD. staticGiven the following code:if (x>0) System.out.println(nfirstn); else if (x>-3) System.out.println(Hsecondn); else System.out.println(nthirdn); Which range of x value would print the string "second”?A. x > 0B. x > -3C. x <= -3D. x <= 0 & x > -3Which statements about the garbage collection are true?A. The program developer must create a thread to be responsible for free the memory.B. The garbage collection will check for and free memory no longer needed.C. The garbage collection allow the program developer to explicity and immediately free the memory.D. The garbage collection can free the memory used java object at expect time.16> Given the uncompleted code of a class:class Person String name, department;int age;public Person(String n) name = n; public Person(String n, int a) name = n; age = a; public Person(String n, String d, int a) / doing the same as two arguments version of constructor/ including assignment name=n,age=a department = d;)Which expression can be added at the "doing the same as." part of the constructor?A. Person(n,a);B. this(Person(n,a);C. this(n,a);D. this(name,age).17> Which of the following statements about variables and their scopes are true?A. Instance variables are member variables of a class.B. Instance variables are declared with the static keyword.C. Local variables defined inside a method are created when the method is executed.D. Local variables must be initialized before they are used.18、public void test() try oneMethod();System.out.println(,'condition 1"); catch (ArraylndexOutOfBoundsException e) System.out.println(ncondition 2"); catch(Exception e) System.out.println(ncondition 3n); finally System.out.println(nfinallyn);)Which will display if oneMethod run normally?A. condition 1B. condition 2C. condition 3D. finally19> Given the following code:public class Test void printValue(int m)do System.out.println(nThe value isn+m);)while( m > 10 )public static void main(String arg |) int i=10;Test t= new Test();t.printValue(i);) ) Which will be output? A. The value is 8 B. The value is 9 C. The value is 10 D. The value is 1120 ,下面的有关声明的哪些叙述是对的。A.对原始数据类型例如boolean,byte的变量的声明不会为该变量分配内存空间。B.对原始数据类型例如boolean,byte的变量的声明将为之分配内存空间。C.非原始数据类型例如String,Vector的变量的声明不会为该对象分配内存。D.非原始数据类型例如String,Vector的变量的声明会为该对象分配内存。 二、填空题(20分)(1 )对象串行化可以很容易地扩展成支持Java对象的1,它提供了对象从流中重建的 补充方式.(2分)(2 ) Vector类的对象是通过capacity和capacity Increment两个值来改变集合的容量,其中 capacity表示集合最多能容纳的2 , capacityincrement表示每次增加多少容量,不是一个一 个增加.(3分)(3)下列程序的功能是判断某一年是否为闰年,请在横线处填入适当内容,使程序能够正确 运行.(5分)import java.io.*;public class Leap Year public static void main(String arge)throws IOException InputStreamReader ir;BufferdeReadwe in;ir=new InputStreamReader(System.in);in=new BufferedReader(ir);System.out.printin(“输入年份是:”); String s= 3 int year=lnteger.parselnt(s);if year % 4 = = 0 && year % 100! = 0 / year % 400 二= 0) (System, out. println(""+year+”年是闰年.”);) else (System, out. println("”+year+”年不是闰年."); ) )(4)下面程序对数组中每个元素赋值,然后按逆序输出.请在横线处填入适当内容,使程序 能正常运行.(5分)import java.io.*;public class ArrayTestpublic static void main(String args) int i;int a = new int5;for(i=0;i<5;i+)a=i;for( 4 i>=0;i-)System.out.println(Han+i+n=na); ) )(5)下列程序的功能是:输入一个姓名,程序运行后,输出“姓名Welcome you!”.例如, 输入“张三Welcome you !”.请在下面横线处填入正确的方法名,使程序可以正确运行.(5 分)import java,awt,*;import java.awt.event.;public class welcomenYoupublic static void main(String args) (new FrameInOut(); )class FramelnOut extends Frame implements ActionListener (Label prompt;TextField input,output;Button btnn;void FramInOut() (prompt=new Label(nPlease input your name*');input=new TextField(lO);output二new TextField(25);btnn=new Button(nClassn);5 (new FlowLayout();add(prompt);add(input);add(output);add(btnn);input.addActionListener(this);btnn.addActionListener(this);setSize(300.200);show();public void actionperformed(ActionEvent e)if(e.getSource() = = input)output.setText(input.getText()+nWelcome you!n); else (dispose();system.exit(O);)三、概念辨析题。(20分)1、解释术语:类;封装;继承.(6分)2、区别基本异常的分类?(8分)3、abstract class 和 interface 有什么区别? (6 分)四、程序设计题。(10分)当用户按或“小时,人为抛出一个算术异常,处理方式为打印出错信息(10分)

    注意事项

    本文(《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx)为本站会员(太**)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

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

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开