- 40
- 0
- 约7.13千字
- 约 7页
- 2018-11-16 发布于江苏
- 举报
西交《Java语言》在线习题
谋学网 HYPERLINK
一、单选题(共 10 道试题,共 20 分。)V 1. 哪个关键字可以对对象加互斥锁?( )
A. transient
B. synchronized
C. serialize
D. static
满分:2 分
2. 对方法main的第1行定义正确的是( )。。
A. public main( String arg [ ] )
B. public void main( String arg [ ] )
C. public static void main( String arg [ ] )
D. public static void main( String args [ ] )
满分:2 分
3. 下列哪些语句关于内存回收的说明是正确的? ( )
A. 程序员必须创建一个线程来释放内存;
B. 内存回收程序负责释放无用内存
C. 内存回收程序允许程序员直接释放内存
D. 内存回收程序可以在指定的时间释放内存对象
满分:2 分
4. 运行下列程序, 会产生什么结果 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. 程序会运行和启动
满分:2 分
5. 看以下程序: boolean a=false; boolean b=true; boolean c=(ab)(!b); int result=c==false?1:2; 这段程序执行完后,c与result的值是:( )。。
A. c=false;result=1;
B. c=true;result=2;
C. c=true;result=1;
D. c=false;result=2;
满分:2 分
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();
满分:2 分
7. 运行下列程序, 会产生什么结果 ( ) 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. 程序会运行和启动
满分:2 分
8. 对于下列代码: public class Parent { public int addValue( int a, int b) { int s; s = a+b; return s; } } class Child extends Parent { } 下述哪些方法可以加入类Child? ( )
A. int addValue( int a, int b ){// do something...}
B. public void addValue (int a
您可能关注的文档
- 苹果S手机实验使用培训教材.doc
- 苹果恢复大师从itunes恢复文件.docx
- 苹果流媒体直播.doc
- 苹果竞争对手研究分析.doc
- 茶文化赏析在线习题A.doc
- 茶饮料制作方法简要详细说明.doc
- 荆轲刺秦王文言基础知识归纳.doc
- 荆门换施工图交底详细说明书(土建部分).doc
- 荒漠生态定位观测指标体系.doc
- 荧光灯质量工艺研究分析——排气工序篇.doc
- 2025年版汽车趋势报告 The 2025 EPA Automotive Trends Report.docx
- 2026年边缘计算开源平台EdgeX Foundry入门与二次开发.docx
- 2026年超声内镜放大内镜早癌诊断AI辅助识别系统临床评价.docx
- 2026年报废汽车回收与再制造逆向物流体系.docx
- 2026年产品碳足迹核算方法学:从摇篮到大门与从摇篮到坟墓.docx
- 2026年城乡要素平等交换双向流动政策创新试点申报材料.docx
- 2026年超导半导体接口电路架构与电平转换驱动器设计.docx
- 2026年财政贴息不再以再贷款支持为前提后的风险防范与合规要点.docx
- 2026年不动产信托登记试点政策对遗嘱信托支持.docx
- 2026年城乡有机废弃物协同处理技术方案.docx
最近下载
- 2021版劳动实践河北科学技术出版社一年级下册全册教案.doc
- 2025年甘肃省平凉市崇信县新窑镇招聘大学生村文书笔试试题附答案解析.docx VIP
- 山西单招古诗题库及答案.doc VIP
- 07K103-2 防排烟系统设备及附件选用及安装.docx VIP
- 《运动损伤与康复》王国祥 7第七章 手腕部运动损伤与康复.ppt VIP
- 化工厂预防火灾.pptx VIP
- 06K301-1 空气-空气能量回收装置选用与安装(新风换气机部分).docx VIP
- 坑槽箱式支护施工方案.docx VIP
- 第十二章 玻璃体病 .ppt VIP
- DB37_T 4919-2025 钢桥面超高性能混凝土铺装技术规范.pdf VIP
原创力文档

文档评论(0)