深圳天源迪科信息技术(JAVA类)面试第一轮试题.doc_第1页
深圳天源迪科信息技术(JAVA类)面试第一轮试题.doc_第2页
深圳天源迪科信息技术(JAVA类)面试第一轮试题.doc_第3页
深圳天源迪科信息技术(JAVA类)面试第一轮试题.doc_第4页
深圳天源迪科信息技术(JAVA类)面试第一轮试题.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

技术人员(JAVA类)面试第一轮试题 深圳天源迪科信息技术股份有限公司技术人员(JAVA类)面试第一轮试题前言:谢谢您信任我们深圳天源迪科信息技术股份有限公司! 我们以严肃的态度、真诚的热情希望您能成为我们公司的员工。希望您能耐心、诚信地完成我们如下的试题。祝您成功。姓名: 李海凤 联系电话:面试时间: 一、选择题:(每题1.5分,计1.5*10=15分)1、class Comp public static void main(String args) float f1 = 2.3f; float f2 = 42.0f, 1.7f, 2.3f, 2.6f, 2.7f; float f3 = 2.7f; Long x = 42L; / 在此处插入代码(分别是F1、F2、F3、F4、F5代码段) System.out.println(true); 代码段:F1. if(f1 = f2) 编译错误F2. if(f1 = f221) 无F3. if(x = f200) tureF4. if(f1 = f21,1) 编译错误F5. if(f3 = f22) 无分别运行程序,最终汇总结果是( D )?A. 一次编译通过, 一次返回true. B. 二次编译通过,一次返回true.C. 三次编译通过, 二次返回true. D. 三次编译通过, 一次返回true.2、执行以下代码,程序输出的结果是( A ) public class StrUtil public static void substr(String str) str.substring(5);public static void main(String args) String s = this is my test;StrUtil.substr(s);System.out.println(s); Athis is my test; Bis my test Cs is my test D my test;3、哪个选项编译有误(C )?int a = 3;Aa = a/2; Ba = a/3; Ca = a/2.3; D全部编译通过4、启动一个线程,类MyRunnable已经实现了java.lang.Runnable接口:MyRunnable myRunnable = new MyRunnable();以下哪个语句可用于启动MyRunnable任务线程:( D )AmyRunnable.run(); BThread thread = new Thread(myRunnable); thread.run();CmyRunnable.start(); DThread thread = new Thread(myRunnable); thread.start();5、Which collection class(es) allows you to grow or shrink its size and provides indexed access toits elements, but whose methods are not synchronized? ( )Ajava.util.HashSet Bjava.util.LinkedHashSetCjava.util.List Djava.util.ArrayList6、public class TwoThreads static Thread laurel, hardy;public static void main(String args) laurel = new Thread() public void run() System.out.println(A);try hardy.sleep(1000); catch (Exception e) System.out.println(B);System.out.println(C);hardy = new Thread() public void run() System.out.println(D);try laurel.wait(); catch (Exception e) System.out.println(E);System.out.println(F);laurel.start();hardy.start();请问哪几个字母将被输出?( )AA,C,D,F BD,E,F CA,C,D DA,C,D,E,F7、class Emu static String s = -;public static void main(String args) try throw new Exception(); catch (Exception e) try try throw new Exception(); catch (Exception ex) s += ic ; throw new Exception(); catch (Exception x) s += mc ; finally s += mf ; finally s += of ; System.out.println(s); 正确的返回结果是( )?A-mc mf B-ic mf of C-ic mc mf of D-ic mc of mf8、编译并运行下面代码,结果为( ) ?public class MyTest public void finalize()throws ThrowableSystem.out.println(Test finalize);public static void main(String args) MyTest test = new MyTest();test.finalize();test = null ;Runtime r = Runtime.getRuntime();r.gc();r.runFinalization();A代码无法编译,因为调用finalize方法有问题;B代码通过编译,但不显示任何东西;C代码通过编译,只会显示一次Test finalize;D代码通过编译,而且会显示二次Test finalize。9、在同样的情况下(注:文件小于2M)分别运行以下代码,哪一个性能最高,速度最好?( )A、import java.io.*; public class intro1 public static void main(String args) if (args.length != 1) System.err.println(missing filename); System.exit(1); try FileInputStream fis = new FileInputStream(args0); int cnt = 0; int b; while (b = fis.read() != -1) if (b = n) cnt+; fis.close(); System.out.println(cnt); catch (IOException e) System.err.println(e); B、import java.io.*; public class intro2 public static void main(String args) if (args.length != 1) System.err.println(missing filename); System.exit(1); try FileInputStream fis = new FileInputStream(args0); BufferedInputStream bis = new BufferedInputStream(fis); int cnt = 0; int b; while (b = bis.read() != -1) if (b = n) cnt+; bis.close(); System.out.println(cnt); catch (IOException e) System.err.println(e); C、import java.io.*; public class intro3 public static void main(String args) if (args.length != 1) System.err.println(missing filename); System.exit(1); try FileInputStream fis = new FileInputStream(args0); byte buf = new byte2048; int cnt = 0; int n; while (n = fis.read(buf) != -1) for (int i = 0; i n; i+) if (bufi = n) cnt+; fis.close(); System.out.println(cnt); catch (IOException e) System.err.println(e); AA最快 BB最快 CC最快 D都一样10、实例化一个类有哪几种方法?( )a.new Xxx();b.clone();c.反序列化d.反射机质的newInstance()方法。比如Class.forName(“”).newInstance();Aa,b,c,d Ba,b,c Ca,b Da,b,d二、简答题1.form中的input有哪些类型(4分)2.javascript里该代码的含义是什么(4分)3.抽象类和接口的区别?(8分)4.多线程有几种实现方法,都是什么?同步有几种实现方法,都是什么?(5分)5.JSP中动态INCLUDE与静态INCLUDE的写法以及它们最大的区别是什么(8分)6.try 里有一个return语句,那么紧跟在这个try后的finally 里的code会不会被执行,什么时候被执行,在return前还是后? (8分)7.客户请求访问HTML页面与访问Servlet有什么异同。(8分)8.描述Struts的工作原理或者工作流程。(10分)9.使用spring框架,如何在JSP里获取BO对象,请简要写出相应的配制代码和获取代码。(10分)10.XML里如何注释某行,请写出注释代码。(5分)11oracle中如何让纵表打成横表 (8分)例如: select name,type,charge from tt name type charge 费用 PHS 1000 费用 ADSL 3000 费用 XDSL 5000 打成横表: name PHS ADSL XDSL 费用 10003000 5000请写出sql:select , sum(case when a.type=PHS then a.charge else 0 end) PHS, sum(case when a.type=ADSL then a.charge else 0 end) A

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论