杭州天麗科技有限公司面試筆試題_第1頁
杭州天麗科技有限公司面試筆試題_第2頁
杭州天麗科技有限公司面試筆試題_第3頁
杭州天麗科技有限公司面試筆試題_第4頁
杭州天麗科技有限公司面試筆試題_第5頁
免費預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

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:what will happen when you

3、 attempt to compile and run the following code? class base int i = 99; public 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 voi

4、d amethod() system.out.println(derived.amethod(); choices:error! reference 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

5、:使用 jdbc 可以做到的是 error! reference source not found.a.把二進制代碼傳送到任何關(guān)系數(shù)據(jù)庫中 error! reference source not found.b.把 java 源代碼傳送到任何關(guān)系數(shù)據(jù)庫中 error! reference source not found.c.把表單信息傳送到任何關(guān)系數(shù)據(jù)庫中 error! reference source not found.d.很容易地把 sql 語句傳送到任何關(guān)系數(shù)據(jù)庫中 3: 1. strings=”examplestring”;whichoperationisnotlegal?stri

6、ng s=”example string”;which operation is not legal?error! reference source 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. publicobje

7、ctm() 4. 5. objecto=newfloat(3.14f);/line3 6. 7. objectoa=newobject1;/line4 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 obje

8、ct oa = new object1;/line 4 oa0 = o;/line 5 o=null;/line 6 return oa0;/line 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.j

9、ust after line 7(that is,as the method returns) error! reference source not 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.

10、*; package testpackage; public class test/ do something. error! reference 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:在下述選項時,沒有構(gòu)成死循環(huán)的程序是 e

11、rror! reference source not found.a.int i=100 while (1) i=i%100+1; if (i100) 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

12、application? error! reference source not found.a.string error! reference 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

13、0000 0000 4 give 0000 1010 0000 0000 0000 0000 0000 0000 error! reference 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 00

14、00 error! reference source not found.d.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 9: 1. whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. (assumethatthecodeiscompiledandrunwithassertionsenabled.) 4. 5. publicclassasserttest 6. 7. publicvoi

15、dmethoda(inti) 8. 9. asserti=0:methodb(); 10. 11. system.out.println(i); 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. w

16、hat will happen when you attempt to compile and run the following code?(assume 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 neg

17、ative);public static void main(string args)asserttest test = new asserttest();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 no

18、t found.c.the code will not compile. error! reference source not found.d.none of these. 10: 1. thefollowingcodeisentirecontentsofafilecalledexample.java,causespreciselyoneerrorduringcompilation: 2. classsubclassextendsbaseclass 3. 4. classbaseclass() 5. stringstr; 6. publicbaseclass() 7. system.out.

19、println(“ok”); 8. publicbaseclass(strings) 9. str=s; 10. publicclassexample 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 precis

20、ely one error during compilation: class subclass extends baseclass class 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 w

21、ould be cause the error? error! reference source not found.a.9 error! reference 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 b

22、e used? error! reference source not found.a.protected error! reference source not found.b.public error! reference source not found.c.no modifer error! reference source not found.d.private 12:鑒于java的特點,它最適合的計算環(huán)境是 error! reference source not found.a.并行計算環(huán)境 error! reference source not found.b.分布式計算環(huán)境 e

23、rror! reference source not found.c.高強度計算環(huán)境 error! reference source not found.d.開放式計算環(huán)境 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. givethefollowingm

24、ethod: 2. publicvoidmethod() 3. stringa,b; 4. a=newstring(“helloworld”); 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, whic

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論