- 1、本文档共24页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Java题库—175道选择题
《Java程序设计》理论题库—选择题(单选175题)
?
1.欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的 ? B
A、 ArrayList myList=new Object();
B、 List myList=new ArrayList();
C、 ArrayList myList=new List();
D、 List myList=new List();
2.paint()方法使用哪种类型的参数?
A、 Graphics
B、 Graphics2D
C、 String
D、 Color
3.指出正确的表达式
A、 byte=128; B、 Boolean=null;
C、 long l=0xfffL;
D、 double=0.9239d;
4.指出下列程序运行的结果 public class Example{ String str=new String(good); char[]ch={a,b,c}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.print(ex.str+ and ); Sytem.out.print(ex.ch); } public void change(String str,char ch[]){ str=test ok; ch[0]=g; } }
A、 good and abc
B、 good and gbc
C、test ok and abc
D、 test ok and gbc 5.运行下列程序, 会产生什么结果 public class X extends Thread implements Runable{ public void run(){ System.out.println(this is run()); } public static void main(String args[]) { Thread t=new Thread(new X()); t.start(); } }
A、 第一行会产生编译错误
B、 第六行会产生编译错误
C、 第六行会产生运行错误
D、 程序会运行和启动 6.要从文件 file.dat文件中读出第10个字节到变量C中,下列哪个方法适合? A、 FileInputStream in=new FileInputStream(file.dat); in.skip(9); int c=in.read();
B、 FileInputStream in=new FileInputStream(file.dat); in.skip(10); int c=in.read();
C、 FileInputStream in=new FileInputStream(file.dat); int c=in.read();
D、 RandomAccessFile in=new RandomAccessFile(file.dat); in.skip(9); int c=in.readByte(); 7.容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而改变? A、 CardLayout
B、 FlowLayout
C、 BorderLayout
D、 GridLayout 8.给出下面代码: public class Person{ static int arr[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1]); } } 那个语句是正确的? A、 编译时将产生错误;
B、 编译时正确,运行时将产生错误;
C 、输出零;
D、 输出空。 9.哪个关键字可以对对象加互斥锁? A、 transient
B synchronized
C serialize
D static 10.下列哪些语句关于内存回收的说明是正确的?
A、 程序员必须创建一个线程来释放内存;
B、 内存回收程序负责释放无用内存
C、内存回收程序允许程序员直接释放内存
D、内存回收程序可以在指定的时间释放内存对象 11.下列代码哪几行会出错: 1) public void modify() { 2) int I, j, k;
您可能关注的文档
最近下载
- 鸡尾酒培训—财务部分.ppt
- 喜茶品牌手册.pdf
- 高中英语2025届高考高频词(共240个).doc
- 2025届漳州高三1月市质检(漳州二检)数学试题含答案.pdf
- 福建省部分(六市)地市2025届高三上学期第一次质量检测试题(六市一模)数学试卷含答案.pdf VIP
- 福建省部分(六市)地市2025届高中毕业班第一次质量检测(六市一模)数学.docx VIP
- 2024年智慧旅游服务普及率大幅提升.pptx
- 2024新修订《公司法》重点学习.pptx
- 数学丨重庆市主城五区一诊高2025届高三1月暨学业质量调研抽测数学试卷及答案.pdf VIP
- 同等学力硕士全国统考心理学--普心考点精要.pdf VIP
文档评论(0)