电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

java笔试试题集合

90页
  • 卖家[上传人]:小**
  • 文档编号:93290832
  • 上传时间:2019-07-19
  • 文档格式:PDF
  • 文档大小:601.44KB
  • / 90 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 1、1 Copyright Tarena Corporation,2009.All rights reserved JAVASEJAVASE 部分部分 1、Choose the three valid identifiers from those listed below. (Choose three)? A. IDoLikeTheLongNameClass B. $byte C. const D. _ok E. 3_case 答:ABD 2、Which of the following lines of code will compile without error (Choose two)? A. int i=0; if (i) System.out.println(“Hi”); B. boolean b=true; boolean b2=true; if(b=b2) System.out.println(“So true”); C. int i=1; int j=2; if(i=1| j=2) System.out.println(“OK”); D. int i=1; int j=2

      2、; if (i=1 答:BC 3、Which two demonstrate a “has a“ relationship(Choose two)? A. public interface Person public class Employee extends Person B. public interface Shape public interface Rectandle extends Shape C. public interface Colorable public class Shape implements Colorable D. public class Species 2 Copyright Tarena Corporation,2009.All rights reserved public class Animalprivate Species species; E. interface Component class Container implements Component private Component children; 答:DE 4、What

      3、will happen when you attempt to compile and run the following code? public class Static static int x = 5; static int x,y; public static void main(String args) x-; myMethod(); System.out.println(x + y + +x); public static void myMethod() y = x+x; A.compiletime error B.prints: 1 C.prints: 2 D.prints: 3 E.prints: 7 F.prints: 8 答:D 5、What is the correct ordering for the import, class and package declarations when found in a single file? A. package, import, class B. class, import, package C. import,

      4、package, class D. package, class, import 答:A 6、What will happen when you attempt to compile and run the following code. public class Pvf static boolean Paddy; public static void main(String argv) System.out.println(Paddy); 3 Copyright Tarena Corporation,2009.All rights reserved A. Compile time error B. compilation and output of false C. compilation and output of true D. compilation and output of null 答:B 7、Given the folowing classes which of the following will compile without error? interface IF

      5、ace class CFace implements IFace class Base public class ObRef extends Base public static void main(String argv) ObRef ob = new ObRef(); Base b = new Base(); Object o1 = new Object(); IFace o2 = new CFace(); A. o1=o2; B. b=ob; C. ob=b; D. o1=b; 答:ABD 8、下面那几个函数是 public void method().的重载函数? A)public void method( int m). B)public int method(). C) public void method2(). D) public int method(int m, float f ). 答:AD 9、给出如下声明: String s = “Example”; 合法的代码有哪些? A)s=3 B)s3= “X” C)int i = s.length() D)s = s

      6、+ 10 答:CD 10、如下哪些不是 java 的关键字? A)const B)NULL C) false D)this E) native 答:B 11、关于垃圾收集的哪些叙述是对的 A)程序开发者必须自己创建一个线程进行内存释放的工作 B)垃圾收集将检查并释放不在使用的内存 C)垃圾收集允许程序开发者明确指定并立即释放该内存 D)垃圾收集能够在期望的时间释放被 java 对象使用的内存 答:B 12、已知表达式 int m = 0,1,2,3,4,5,6; 下面哪个表达式的值与数组下标量总数相等? A)m.length() B)m.length C)m.length()+1 D)m.length-1 4 Copyright Tarena Corporation,2009.All rights reserved 答:D 13、方法 resume()负责恢复哪些线程的执行 A)通过调用 stop()方法而停止的线程。 B)通过调用 sleep()方法而停止的线程。 C)通过调用 wait()方法而停止的线程。 D)通过调用 suspend()方法而停止的线程。 答:D 14、有关线程

      7、的哪些叙述是对的 A)一旦一个线程被创建,它就立即开始运行。 B)使用 start()方法可以使一个线程成为可运行的,但是它不一定立即开始运 行。 C)当一个线程因为抢先机制而停止运行,它被放在可运行队列的前面。 D)一个线程可能因为不同的原因停止并进入可运行状态。 答:BCD 15、已知如下代码: public class Test long a = new long 10; public static void main(String arg ) System.out.print(a6); 请问哪个语句是正确的? A)Output is null. B)Output is 0 C)When compile, some error will occur. D)When running, some error will occur. 答:C 16、已知如下代码: public class Test public static void main(String arg ) int i = 5; do System.out.print(i); while(-i5); System.out.

      8、print(“finished”); 执行后的输出是什么? A)5 B)4 C)6 D)finished 5 Copyright Tarena Corporation,2009.All rights reserved 答:AD 17、已知如下代码: switch (m) case 0: System.out.print(“Condition 0”); case 1: System.out.print(“Condition 1”); case 2: System.out.print(“Condition 2”); case 3: System.out.print(“Condition 3”); default: System.out.print(“Other Condition ”); 当 m 的值为什么时能输出“Condition 2” A)0 B)1 C)2 D)3 E) 4 F)None 答:ABC 18、下面的哪些声明是合法的? A)long 1 = 4990 B)int i = 4L C)float f =1.1 D)double d = 34.4 答:AD 19、给出如下代码

      9、: class Test private int m; public static void fun() /some code 如何使成员变量 m 被函数 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 答:C 20、以下哪个方法用于定义线程的执行体? A)start() B)init() C)run() D)main() E)synchronized() 答:C 21、请看如下代码 class Person private int a; public int change(int m) return m; public class Teacher extends Person public int b; 6 Copyright Tarena Corporation,2009.All rights reserved public static void main(String arg) Person p = new Person(); Teacher t = new Teacher(); int i; / point x 下面哪些放在/ point x?行是正确的? A i = m; B i = b; C i = p.a; D i = p.change(30); E i = t.b; 答:DE 22、给出下面的代码段: ( ) public class Base i

      《java笔试试题集合》由会员小**分享,可在线阅读,更多相关《java笔试试题集合》请在金锄头文库上搜索。

      点击阅读更多内容
    最新标签
    信息化课堂中的合作学习结业作业七年级语文 发车时刻表 长途客运 入党志愿书填写模板精品 庆祝建党101周年多体裁诗歌朗诵素材汇编10篇唯一微庆祝 智能家居系统本科论文 心得感悟 雁楠中学 20230513224122 2022 公安主题党日 部编版四年级第三单元综合性学习课件 机关事务中心2022年全面依法治区工作总结及来年工作安排 入党积极分子自我推荐 世界水日ppt 关于构建更高水平的全民健身公共服务体系的意见 空气单元分析 哈里德课件 2022年乡村振兴驻村工作计划 空气教材分析 五年级下册科学教材分析 退役军人事务局季度工作总结 集装箱房合同 2021年财务报表 2022年继续教育公需课 2022年公需课 2022年日历每月一张 名词性从句在写作中的应用 局域网技术与局域网组建 施工网格 薪资体系 运维实施方案 硫酸安全技术 柔韧训练 既有居住建筑节能改造技术规程 建筑工地疫情防控 大型工程技术风险 磷酸二氢钾 2022年小学三年级语文下册教学总结例文 少儿美术-小花 2022年环保倡议书模板六篇 2022年监理辞职报告精选 2022年畅想未来记叙文精品 企业信息化建设与管理课程实验指导书范本 草房子读后感-第1篇 小数乘整数教学PPT课件人教版五年级数学上册 2022年教师个人工作计划范本-工作计划 国学小名士经典诵读电视大赛观后感诵读经典传承美德 医疗质量管理制度 2 2022年小学体育教师学期工作总结
    关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
    手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
    ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.