杭州天丽科技有限公司面试笔试题.doc

上传人:rrsccc 文档编号:9924608 上传时间:2021-04-04 格式:DOC 页数:6 大小:131KB
返回 下载 相关 举报
杭州天丽科技有限公司面试笔试题.doc_第1页
第1页 / 共6页
杭州天丽科技有限公司面试笔试题.doc_第2页
第2页 / 共6页
杭州天丽科技有限公司面试笔试题.doc_第3页
第3页 / 共6页
杭州天丽科技有限公司面试笔试题.doc_第4页
第4页 / 共6页
杭州天丽科技有限公司面试笔试题.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《杭州天丽科技有限公司面试笔试题.doc》由会员分享,可在线阅读,更多相关《杭州天丽科技有限公司面试笔试题.doc(6页珍藏版)》请在三一文库上搜索。

1、选择题 1: 1. Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. classBase 4. 5. 6. 7. inti=99; 8. 9. publicvoidamethod() 10. 11. 12. 13. System.out.println(Base.amethod(); 14. 15. 16. 17. Base() 18. 19. 20. 21. amethod(); 22. 23. 24. 25. 26. 27. publicclassDerivedextendsBase 28. 29. 30.

2、 31. inti=-1; 32. 33. 34. 35. publicstaticvoidmain(Stringargv) 36. 37. 38. 39. Baseb=newDerived(); 40. 41. System.out.println(b.i); 42. 43. b.amethod(); 44. 45. 46. 47. publicvoidamethod() 48. 49. 50. 51. System.out.println(Derived.amethod(); 52. 53. 54. 55. 56. 57. Choices:class Base int i = 99; pu

3、blic void amethod() System.out.println(Base.amethod(); Base() amethod(); public class Derived extends Baseint i = -1; public static void main(String argv) Base b = new Derived(); System.out.println(b.i); b.amethod(); public void amethod() System.out.println(Derived.amethod(); Choices:Error! Referenc

4、e source not found.A.Derived.amethod() -1 Derived.amethod() Error! Reference source not found.B.Derived.amethod() 99 Error! Reference source not found.C.Compile time error Error! Reference source not found.D.Derived.amethod() 2:使用 JDBC 可以做到的是 Error! Reference source not found.A.把二进制代码传送到任何关系数据库中 Err

5、or! Reference source not found.B.把 Java 源代码传送到任何关系数据库中 Error! Reference source not found.C.把表单信息传送到任何关系数据库中 Error! Reference source not found.D.很容易地把 SQL 语句传送到任何关系数据库中 3: 1. Strings=”ExampleString”;Whichoperationisnotlegal?String s=”Example String”;Which operation is not legal?Error! Reference sourc

6、e not found.A.int i=s.length(); Error! Reference source not found.B.s3=”x”; Error! Reference source not found.C.String short_s=s.trim(); Error! Reference source not found.D.String t=”root”+s; 4: 1. publicclassX 2. 3. publicObjectm() 4. 5. Objecto=newFloat(3.14F);/line3 6. 7. Objectoa=newObject1;/lin

7、e4 8. 9. oa0=o;/line5 10. 11. o=null;/line6 12. 13. returnoa0;/line7 14. 15. 16. 17. 18. WhenistheFloatobject,createdinline3,eligibleforgarbagecollection?public class X public Object m() Object o = new Float(3.14F);/line 3 Object oa = new Object1;/line 4 oa0 = o;/line 5 o=null;/line 6 return oa0;/li

8、ne 7 When is the Float object, created in line 3,eligible for garbage collection?Error! Reference source not found.A.just after line 5. Error! Reference source not found.B.just after line 6 Error! Reference source not found.C.just after line 7(that is,as the method returns) Error! Reference source n

9、ot found.D.never in this method 5:Which fragments are not correct in Java source file? Error! Reference source not found.A.package testpackage; public class Test/do something. Error! Reference source not found.B.import java.io.*; package testpackage; public class Test/ do something. Error! Reference

10、 source not found.C.import java.io.*; class Person/ do something. public class Test/ do something. Error! Reference source not found.D.import java.io.*; import java.awt.*; public class Test/ do something. 6:在下述选项时,没有构成死循环的程序是 Error! Reference source not found.A.int i=100 while (1) i=i%100+1; if (i10

11、0) break; Error! Reference source not found.B.for (;); Error! Reference source not found.C.int k=1000; do +k; while(k=10000); Error! Reference source not found.D.int s=36; while (s);-s; 7:Which is the main() method return of a application? Error! Reference source not found.A.String Error! Reference

12、source not found.B.byte Error! Reference source not found.C.char Error! Reference source not found.D.void 8:Use the operator “” and “”. Which statement is true? Error! Reference source not found.A.1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 1010 0000 0000 0000 0000 0000 0000 Error! Reference

13、 source not found.B.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 Error! Reference source not found.C.1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 0000 0000 0000 0000 0000 0000 0000 Error! Reference source not found.D.1010 0000 0000 0000 0000 0000 0000

14、 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 9: 1. Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. (Assumethatthecodeiscompiledandrunwithassertionsenabled.) 4. 5. publicclassAssertTest 6. 7. publicvoidmethodA(inti) 8. 9. asserti=0:methodB(); 10. 11. System.out.println(i);

15、12. 13. 14. 15. publicvoidmethodB() 16. 17. System.out.println(Thevaluemustnotbenegative); 18. 19. 20. 21. publicstaticvoidmain(Stringargs) 22. 23. AssertTesttest=newAssertTest(); 24. 25. test.methodA(-10); 26. 27.28. 29. 30. What will happen when you attempt to compile and run the following code?(A

16、ssume that the code is compiled and run with assertions enabled.)public class AssertTestpublic void methodA(int i)assert i = 0 : methodB();System.out.println(i);public void methodB() System.out.println(The value must not be negative);public static void main(String args)AssertTest test = new AssertTe

17、st();test.methodA(-10); Error! Reference source not found.A.it will print -10 Error! Reference source not found.B.it will result in AssertionError showing the message-“the value must not be negative”. Error! Reference source not found.C.the code will not compile. Error! Reference source not found.D.

18、None of these. 10: 1. ThefollowingcodeisentirecontentsofafilecalledExample.java,causespreciselyoneerrorduringcompilation: 2. classSubClassextendsBaseClass 3. 4. classBaseClass() 5. Stringstr; 6. publicBaseClass() 7. System.out.println(“ok”); 8. publicBaseClass(Strings) 9. str=s; 10. publicclassExamp

19、le 11. publicvoidmethod() 12. SubClasss=newSubClass(“hello”); 13. BaseClassb=newBaseClass(“world”); 14. 15. 16. 17. Whichlinewouldbecausetheerror?The following code is entire contents of a file called Example.java,causes precisely one error during compilation: class SubClass extends BaseClass class

20、BaseClass() String str; public BaseClass() System.out.println(“ok”); public BaseClass(String s) str=s; public class Example public void method() SubClass s=new SubClass(“hello”); BaseClass b=new BaseClass(“world”); Which line would be cause the error? Error! Reference source not found.A.9 Error! Ref

21、erence source not found.B.10 Error! Reference source not found.C.11 Error! Reference source not found.D.12 11:A class design requires that a member variable should be accessible only by same package, which modifer word should be used? Error! Reference source not found.A.protected Error! Reference so

22、urce not found.B.public Error! Reference source not found.C.no modifer Error! Reference source not found.D.private 12:鉴于Java的特点,它最适合的计算环境是 Error! Reference source not found.A.并行计算环境 Error! Reference source not found.B.分布式计算环境 Error! Reference source not found.C.高强度计算环境 Error! Reference source not fo

23、und.D.开放式计算环境 13:Math.round(-11.5)等於多少? Error! Reference source not found.A.-11 Error! Reference source not found.B.-12 Error! Reference source not found.C.-11.5 Error! Reference source not found.D.none 14: 1. Givethefollowingmethod: 2. publicvoidmethod() 3. Stringa,b; 4. a=newString(“helloworld”);

24、5. b=newString(“gameover”); 6. System.out.println(a+b+”ok”); 7. a=null; 8. a=b; 9. System.out.println(a); 10. 11. Intheabsenceofcompileroptimization,whichistheearliestpointtheobjectareferedisdefinitelyelibiletobegarbagecollection.Give the following method: public void method( ) String a,b; a=new Str

25、ing(“hello world”); b=new String(“game over”); System.out.println(a+b+”ok”); a=null; a=b; System.out.println(a); In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.Error! Reference source not found.A.before line 5

26、Error! Reference source not found.B.before line 6 Error! Reference source not found.C.before line 7 Error! Reference source not found.D.before line 9 简答题 15:确定模块的功能和模块的接口是在软件设计的那个队段完成的? 16:给出了从纽约出发和到达洛杉机的各种航班信息,写出找到一条从纽约到洛杉机的最短距离的航班组合的代码。 17:说出Servlet的生命周期,并说出Servlet和CGI的区别。 18: 1. abstractclassSome

27、thing 2. privateabstractStringdoSomething(); 3. 4. 分析上面的代码,正确还是错误。并说明原因。abstract class Something private abstract String doSomething ();分析上面的代码,正确还是错误。并说明原因。19:Java中异常处理有什么优点? 20:char型变量中能不能存贮一个中文汉字?为什么? 21:struts2中的拦截器,你用过那些自带的拦截器,自己写过的吗? 22:用两个栈实现一个队列的功能? 23:将一个链表逆序. 24:如何启动时不需输入用户名与密码? 25:输入一个五位以内的正整数,(1)判断它是一个几位数;(2)请按序输出其各位数字;(3)逆序输出其各位数字。 如输入:56439,输出:5位数 5,6,4,3,9 9,3,4,6,5

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1