2022年java工程师面试题 .pdf

上传人:Che****ry 文档编号:34261642 上传时间:2022-08-15 格式:PDF 页数:10 大小:205.97KB
返回 下载 相关 举报
2022年java工程师面试题 .pdf_第1页
第1页 / 共10页
2022年java工程师面试题 .pdf_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《2022年java工程师面试题 .pdf》由会员分享,可在线阅读,更多相关《2022年java工程师面试题 .pdf(10页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、西安三元数码软件有限公司外派 JAVA 软件工程师笔试题4303 返回上级目录选择题1:在软件生命周期中,下列哪个说法是不准确的? A.软件生命周期分为计划、开发和运行三个阶段B.在计划阶段要进行问题焉醛和需求分析C.在开发后期要进行编写代码和软件测试D.在运行阶段主要是进行软件维护2:public class Parent int change() class Child extends Parent Which methods can be added into class Child? A.public int change() B.abstract int chang() C.priv

2、ate int change() D.none 3:1. Give the following method: 2. public void method( ) 3. String a,b; 4. a=new String(“hello world ”); 5. b=new String(“game over ”); 6. System.out.println(a+b+”ok”); 7. a=null; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 10 页 - - -

3、 - - - - - - 8. a=b; 9. System.out.println(a); 10. 11. In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection. A.before line 5 B.before line 6 C.before line 7 D.before line 9 4:1. String s=”ExampleString”;Which operati

4、on is not legal? A.int i=s.length(); B.s3=”x”; C.String short_s=s.trim(); D.String t=”root ”+s; 5:关于垃圾收集的哪些叙述是对的。A.程序开发者必须自己创建一个线程进行内存释放的工作。B.垃圾收集将检查并释放不再使用的内存。C.垃圾收集允许程序开发者明确指定并立即释放该内存。D.垃圾收集能够在期望的时间释放被java 对象使用的内存。6:1. Give the following code: 2. public class Example 3. public static void main(Str

5、ing args ) 4. int l= 0; 5. do 6. System.out.println(“Doing it for l is: ”+l); 7. while(-l 0) 8. System.out.println(“Finish ”); 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 10 页 - - - - - - - - - 9. 10. 11. Which well be output: A.Doing it for l is 3 B.Doing i

6、t for l is 1 C.Doing it for l is 2 D.Doing it for l is 0 7: 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 pl

7、atform independent D.An object becomes eligible for garbage collection when all references denoting it are set to null. 8:下面关于变量及其范围的陈述哪些是错的。A.实例变量是类的成员变量。B.实例变量用关键字static 声明。C.在方法中定义的局部变量在该方法被执行时创建D.局部变量在使用前必须被初始化。9:1. Which is the most appropriate code snippet that can be inserted at line 18 in th

8、e following code? 2. 3. (Assume that the code is compiled and run with assertions enabled) 4. 5. 1. import java.util.*; 6. 7. 2. 8. 9. 3. public class AssertTest 10. 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 10 页 - - - - - - - - - 11. 4. 12. 13. 5. private

9、 HashMap cctld; 14. 15. 6. 16. 17. 7. public AssertTest() 18. 19. 8. 20. 21. 9. cctld = new HashMap(); 22. 23. 10. cctld.put(in, India); 24. 25. 11. cctld.put(uk, United Kingdom); 26. 27. 12. cctld.put(au, Australia); 28. 29. 13. / more code. 30. 31. 14. 32. 33. 15. / other methods . 34. 35. 16. pub

10、lic String getCountry(String countryCode) 36. 37. 17. 38. 39. 18. / What should be inserted here? 40. 41. 19. String country = (String)cctld.get(countryCode); 42. 43. 20. return country; 44. 45. 21. 46. 47. 22. A.assert countryCode != null; B.assert countryCode != null : Country code can not be null

11、 ; C.assert cctld != null : No country code data is available; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 10 页 - - - - - - - - - D.assert cctld : No country code data is available; 10: 在下述选项时 ,没有构成死循环的程序是A.int i=100 while (1) i=i%100+1; if (i100) break; B.f

12、or (;); C.int k=1000; do +k; while(k=10000); D.int s=36; while (s);-s; 11:1. 给出下面的代码片断。下面的哪些陈述为错误的? 2. 1) public void create() 3. 2) Vector myVect; 4. 3) myVect = new Vector(); 5. 4) A.第二行的声明不会为变量myVect分配内存空间。B.第二行语句创建一个Vector 类对象。C.第三行语句创建一个Vector 类对象。D.第三行语句为一个Vector 类对象分配内存空间12:A class design req

13、uires 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 13:1. Give the following java source fragement: 2. /point x 3. public class Interesting 4. /do something 5. 6. Which statement is correctly Java synt

14、ax at point x? 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 10 页 - - - - - - - - - A.public class MyClass/do other thing B.static int PI=3.14 C.class MyClass/do something D.none 14:Which fragments are not correct in Java source file? A.package testpackage; pu

15、blic class Test/do something. B.import java.io.*; package testpackage; public class Test/ do something. C.import java.io.*; class Person/ do something. public class Test/ do something. D.import java.io.*; import java.awt.*; public class Test/ do something. 15: 以下的 C 程序代码片段运行后C 和 d 的值分别是多少Int a =1,b

16、=2; Int c,d; c =(a&b)&a; d =(a&b)&a; A.0,0 B.0,1 C.1,0 D.1,1 16:1. What will be the result of executing the following code? 2. 3. public static void main(String args) 4. 5. char digit = a; 6. for (int i = 0; i 10; i+) 7. 8. switch (digit) 9. 10. case x : 11. 12. int j = 0; 名师资料总结 - - -精品资料欢迎下载 - - -

17、 - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 10 页 - - - - - - - - - 13. System.out.println(j); 14. 15. default : 16. 17. int j = 100; 18. System.out.println(j); 19. 20. 21. 22. int i = j; 23. System.out.println(i); 24. 25. 26. Choices: A.100 will be printed 11 times. B.The code will n

18、ot compile because the variable i cannot be declared twice within the main() method. C.The code will not compile because the variable j cannot be declared twice within the switch statement. D.None of these. 17:1. Give this class outline: 2. class Example 3. private int x; 4. /rest of class body 5. 6

19、. Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java? A.Change private int x to public int x B.change private int x to static int x C.Change private int x to protected int x D.change private int x to final int x 18:Whi

20、ch are not Java keywords? 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 10 页 - - - - - - - - - A.TRUE B.const C.super D.void 19: 设有变量说明语句int a=1,b=0; 则执行以下程序段的输出结果为()。switch (a) case 1: switch (b) case 0:printf(*0*);break; case 1:printf(*1*);break; case 2:prin

21、tf(*2*);break; printf(n); A.*0* B.*0*2* C.*0*1*2* D.有语法错误20: 软件生命周期的瀑布模型把软件项目分为3 个阶段、 8 个子阶段,以下哪一个是正常的开发顺序 ? A.计划阶段、开发阶段、运行阶段B.设计阶段、开发阶段、编码阶段C.设计阶段、编码阶段、维护阶段D.计划阶段、编码阶段、测试阶段21:1. What will happen when you attempt to compile and run the following code? 2. 3. class Base 名师资料总结 - - -精品资料欢迎下载 - - - - -

22、- - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 10 页 - - - - - - - - - 4. 5. 6. 7. int i = 99; 8. 9. public void amethod() 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. public class Derived extends Base 28. 29. 30.

23、 31. int i = - 1; 32. 33. 34. 35. public static void main(String argv) 36. 37. 38. 39. Base b = new Derived(); 40. 41. System.out.println(b.i); 42. 43. b.amethod(); 44. 45. 46. 47. public void amethod() 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 10 页 - - -

24、- - - - - - 48. 49. 50. 51. System.out.println(Derived.amethod(); 52. 53. 54. 55. 56. 57. Choices: A.Derived.amethod() -1 Derived.amethod() B.Derived.amethod() 99 C.Compile time error D.Derived.amethod() 简答题22: 怎样在复杂的各种形式的网页中提取mp3 下载的结构化数据?23: 编写一程序,利用RandomAccessFile类将一个文件的全部内容追加到另一个文件的末尾。24: 已知 ab

25、c+cba=1333,其中 a,b,c 均为一位数,编程求出满足条件的a,b,c 所有组合。25:servlet 的生命周期? 26:Static Inner Class 和 Inner Class的不同,说得越多越好。27: 如果有几千个session ,怎么提高效率。28:1. public class Something 2. void doSomething () 3. private String s = ; 4. int l = s.length(); 5. 6. 7. 有错吗 ? 29: 是否可以从一个static 方法内部发出对非static 方法的调用?30: error 和 exception有什么区别 ? 31: Is Tomcat faster than serving static HTML pages than Apache httpd? 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 10 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com