免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
北京东华合创数码科技股份有限公司笔试试卷(Java 语言部分)姓名: 联系方式: 1. which wont cause a compiler warning or error?(多选)a) float f = 1.3;b) char c = a;c) byte b = 257;d) boolean b = null;e) int i = 10;2. 请选择下面这段代码的输出结果?int i = 0;switch (i) case 0:System.out.println(zero);case 1:System.out.println(one);case 2:System.out.println(two);break;case 3: System.out.println(three);1) zero2) zero,one3) zero,one,two4) zero,one,two,three3. public class Test private static int j=0; public static boolean methodB(int k) j+=k; return true; public static void methodA(int i) boolean b; b=i10&methodB(1); b=i10&methodB(2); public static void main(String args) methodA(0); 17) what is the value of j at line 17? 1)0 2)1 3)24)34. If we execute the code below with “java Test Red Green Blue”, what is the result? public class Test public static void main(String args) String foo=args1; String bar=args2; String baz=args3; what is the value of baz? A. baz has value of B. baz has value of null C. baz has value of Red D. baz has value of Blue E. baz has value of Green F. the code does not compile G. the program throw an exception5. 请选择下面这段代码的输出结果?1)public class Test 2)public static void main(String args) 3) class Foo 4) public int i=3; 5) 6)Object o=(Object)new Foo(); 7) Foo foo=(Foo)o; 8)System.out.println(foo.i); 9) 10) A.compile error at line 6 B.compile error at line 7 C.compile error at line 8 D.print out 36. int index=1; String test=new String3; String foo=testindex; what is the result of foo? A. B.null C.throw a Exception D.not compile7. 下面的五个选择中哪两个描述是正确的?(多选) A. static inner class requires a static initializer B. A static inner class requires an instance of the enclosing class C. A static inner class has no reference to an instance of the enclosing class D. A static inner class has accesss to the non-static member of the other class E. static members of a static inner class can be referenced using the class name of the static inner class8. 请选择下面这段代码的输出结果? class A public int getNumber(int a) return a+1; class B extends A public int getNumber(int a, char c) return a+2; public static void main(String args) B b=new B(); System.out.println(b.getNumber(0); A. compilation succeeds and 1 is printed B. compilation succeeds and 2 is printed C. An error at line 8 cause compilation to fail D. An error at line 14 cause compilation to fail9. class ExceptionTest public static void main(String args) try methodA(); catch(IOException e) System.out.println(caught IOException); catch(Exception e) System.out.println(caught Exception); If methodA() throws a IOException, what is the result?If we change the sequence of catch,whats the result?10. 请写出下面这段代码的输出结果?public class Test public static void main(String args) StringBuffer a=new StringBuffer(A); StringBuffer b=new StringBuffer(B); operate(a,b); System.out.pintln(a+,+b); public static void operate(StringBuffer x, StringBuffer y) x.append(y); y=x; 11. 请写出下面这段代码的输出结果?class Shape Shape(int i) System.out.println(This is Shape + i); public class Circle extends Shape static Shape s1 = new Shape(1); Shape s2 = new Shape(3); Circle(int i) super(i); System.out.println(This is Circle + i); public static void main(Str
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 44089-2024信息技术全双工语音交互系统通用技术要求
- 下学期二年级数学集体备课教案
- JAVA继承类求几何图形面积周长代码
- 2006年4月全国计算机等级考试二级JAVA笔试试题及答案
- 六年级上英语导学案-Unit1-2复习6-人教(PEP)
- 城市大脑与超级智能建设规范研究报告1.0-20200302
- 五年级上册美术教学设计-第14课 彩绳装饰瓶 ▏人美版(北京)
- GB 16895.23-2005-T 建筑物电气装置 第6-61部分:检验-初检
- 2022年度辽宁省安全员之B证(项目负责人)真题练习试卷A卷附答案
- 物业管理公司人事档案管理制度(3篇)
- 2023年山东新华书店招聘笔试参考题库附带答案详解
- 压力弹簧力度计算器及计算公式
- 热切制袋机做出来的袋子一边牢一边不牢怎么办
- 【百日联考】017-供电营业规则试题及答案
- 高英语学情分析范文
- 城管部门廉洁教育PPT廉洁清风进城管精华心灵促发展PPTPPT课件(带内容)
- 人教版七年级下册历史问答题及答案
- 市政给排水总施工组织设计
- WS/T 422-2013高压氧临床应用技术规范
- 2023年湖南外贸职业学院高职单招(英语)试题库含答案解析
- 2023届 二轮复习 微专题(二) 提高农作物产量 学案
评论
0/150
提交评论