杭州天丽科技有限公司面试笔试题_第1页
杭州天丽科技有限公司面试笔试题_第2页
杭州天丽科技有限公司面试笔试题_第3页
杭州天丽科技有限公司面试笔试题_第4页
杭州天丽科技有限公司面试笔试题_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

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

文档简介

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 string(“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 th

温馨提示

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

最新文档

评论

0/150

提交评论