JAVA程序设计模拟试卷3.doc

  1. 1、本文档共11页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
JAVA程序设计模拟试卷3

JAVA程序设计模拟试卷3 一、单项选择题 ??1、1.给定一个Java程序代码,如下:运行编译后,输出结果是(). (选择一项) pubilc class Test{ int count = 9; pubilc void count1(){ int count = 10; SYstem.out.println(count1+count); } pubilc void count2(){ SYstem.out.println(count2+count); } pubilc static void main(String args[]){ Test t =new Twst(); t.count1(); t.count2(); } } (??) ????B? ????A、count1=9 count2=9 ????B、count1=10 count2=9 ????C、count1=10 count2=10 ????D、count1=9 count2=10 ??2、2.给定java代码如下:要使用这段代码能够编译成功,横线处可以填入().(选择两项) pubilc int count(char c,int i,double d){ return______; } (???) ????B? ????A、c*i ????B、c*(int)d ????C、(int)c*d ????D、i*d ??3、3、在 JAVA编程中,Java编译器会将Java程序转换为( )。然后由解释器解释执行(选择一项) ????A? ????A、字节码 ????B、可执行代码 ????C、机器代码 ????D、以上所有选项都不正确 ??4、4、在J2EE中,下列元素经过排序的集合类是(??)。(选择一项) ????D? ????A、LinkedList ????B、Stack ????C、Hashtable ????D、TreeSet ??5、5、分析下面的Java程序: public class yy { public static void main(String[] ards) throws Exception { try { throw new Exception(); }catch(Exception e){ System.out.println(Caught in main()); } System.out.println(nothing); } } 输出结果为(??)。(选择一项) ????A? ????A、Caught in main() nothing ????B、Caught in main() ????C、nothing ????D、没有任何输出 ??6、6、编译并运行下面的Java代码段: char c=a; switch (c) { case a: System.out.println(a); default: System.out.println(default); } 输出结果是(??)。(选择一项) ????B? ????A、代码无法编译,因为switch语句没有一个合法的表达式 ????B、a default ????C、a ????D、default ??7、7、在Java中,执行下面的语句后,c的值为()。(选择一项) String s= Jessica ; char c=s.charAt(6);??(??) ????D? ????A、null ????B、 ????C、c ????D、a ??8、8、在J2EE中,下面的代码中出现编译错误的是(??)。(选择一项) ????D? ????A、File f = new File(/,autoexec.bat); ????B、DataInputStream din = new DataInputStream(new FileInputStream(autoexec.bat)); ????C、InputStreamReader in = new InputStreamReader(System.in); ????D、OutputStreamWriter out = new OutputStreamWriter(System.in); ??9、10、在Java中,要想使只有定义该类所在的包内的类可以访问该类,应该用(??)关键字。(选择一项) ????C? ????A、不需要任何关键字 ????B、private ????C、final ????D、protected ??10

文档评论(0)

153****9595 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档