杭州天丽科技有限公司_JAVA高级程序员

上传人:汽*** 文档编号:486068714 上传时间:2022-12-19 格式:DOC 页数:8 大小:238.50KB
返回 下载 相关 举报
杭州天丽科技有限公司_JAVA高级程序员_第1页
第1页 / 共8页
杭州天丽科技有限公司_JAVA高级程序员_第2页
第2页 / 共8页
杭州天丽科技有限公司_JAVA高级程序员_第3页
第3页 / 共8页
杭州天丽科技有限公司_JAVA高级程序员_第4页
第4页 / 共8页
杭州天丽科技有限公司_JAVA高级程序员_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《杭州天丽科技有限公司_JAVA高级程序员》由会员分享,可在线阅读,更多相关《杭州天丽科技有限公司_JAVA高级程序员(8页珍藏版)》请在金锄头文库上搜索。

1、 . 天丽科技 JAVA高级程序员选择题 1:1. Whatwillbetheresultofexecutingthefollowingcode? 2. booleana=true; 3. booleanb=false; 4. booleanc=true; 5. if(a=true) 6. if(b=true) 7. if(c=trueSomethingsaretrueinthisworld); 8. elseNothingistrueinthisworld!); 9. elseifItstooconfusingtotellwhatistrueandwhatisfalse); 10. else

2、Heythiswontcompile); 11. 12. Choices:What will be the result of executing the following code? boolean a = true; boolean b = false; boolean c = true; if (a = true) if (b = true)Choices:A.The code wont compile B.Some things are true in this world will be printed C.Hey this wont compile will be printed

3、 D.None of these 2: Which of the following statements are true? A.The automatic garbage collection of the JVM prevents programs from ever running out of memory B.A program can suggest that garbage collection be performed and force it C.Garbage collection is platform independent D.An object becomes e

4、ligible for garbage collection when all references denoting it are set to null. 3:1. Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. classBase 4. 5. 6. 7. inti=99; 8. 9. publicvoidamethod() 10. 11. 12. 13. Base.amethod(); 14. 15. 16. 17. Base() 18. 19. 20. 21. amethod(); 22. 23. 2

5、4. 25. 26. 27. publicclassDerivedextendsBase 28. 29. 30. 31. inti=-1; 32. 33. 34. 35. publicstaticvoidmain(Stringargv) 36. 37. 38. 39. Baseb=newDerived(); 40. 41.42. 43. b.amethod(); 44. 45. 46. 47. publicvoidamethod() 48. 49. 50. 51. Derived.amethod(); 52. 53. 54. 55. 56. 57. Choices:What will happ

6、en when you attempt to compile and run the following code? class Base int i = 99; public void amethod() Base() amethod(); public class Derived extends Baseint i = -1;public static void main(String argv) Base b = new Derived(); b.amethod(); public void amethod() Choices:C.Compile time error 4:A class

7、 design requires that a member variable should be accessible only by same package, which modifer word should be used? A.protected B.public C.no modifer D.private 5:假定a和b为int型变量,则执行下述语句组后,b的值为 a=1; b=10; do b-=a; a+; while (b-0); A.9 B.-2 C.-1 D.8 6:1. Whatresultsfromattemptingtocompileandrunthefollo

8、wingcode? 2. 3. publicclassTernary 4. 5. 6. 7. publicstaticvoidmain(Stringargs) 8. 9. 10. 11. inta=5; 12. 13. Valueis-+(a5)?9.9:9); 14. 15. 16. 17. 18. 19. Choices:What results from attempting to compile and run the following code? public class Ternarypublic static void main(String args)int a = 5; C

9、hoices:A.prints: Value is - 9 B.Compilation error C. prints: Value is - 5 D.None of these 7:1. Strings=”ExampleString”;Whichoperationisnotlegal?String s=”Example String”;Which operation is not legal?A.int i=s.length(); B.s3=”x”; C.String short_s=s.trim(); D.String t=”root”+s; 8: Consider the class h

10、ierarchy shown below: - class FourWheeler implements DrivingUtilities class Car extends FourWheeler class Truck extends FourWheeler class Bus extends FourWheeler class Crane extends FourWheeler - Consider the following code below: 1.DrivingUtilities du; 2.FourWheeler fw; 3.Truck myTruck = new Truck(

11、); 4.du = (DrivingUtilities)myTruck; 5.fw = new Crane(); 6.fw = du; Which of the statements below are true? Choices: A.Line 4 will not compile because an interface cannot refer to an object. B.The code will compile and run. C.The code will not compile without an explicit cast at line 6, because goin

12、g down the hierarchy without casting is not allowed. D.The code will compile if we put an explicit cast at line 6 but will throw an exception at runtime. 9:1. Givethefollowingjavaclass: 2. publicclassExample 3. staticintx=newint15; 4. publicstaticvoidmain(Stringargs) 5. 5); 6. 7. 8. Whichstatementiscorrected?Give the following java class:public class Examplestatic int x=new int15;public static void main(String arg

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号