首页 java工程师面试题2

java工程师面试题2

举报
开通vip

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

java工程师面试题2
java 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 师面试 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 2 西安三元数码软件有限公司 外派 JAVA 软件工程师笔试题 4303 返回上级目录 选择题 1:在软件生命周期中,下列哪个说法是不准确的 A.软件生命周期分为 计划 项目进度计划表范例计划下载计划下载计划下载课程教学计划下载 ,开发 和运行三个阶段 B.在计划阶段要进行问题焉醛和需求 分析 定性数据统计分析pdf销售业绩分析模板建筑结构震害分析销售进度分析表京东商城竞争战略分析 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.private 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; 8. a=b; 9. System.out.println(a); 10. } 11. In the absence of compiler optimization, which is the earliest point the object a refere d 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="Example String";Which operation is not legal A.int i=s.length(); B.s[3]="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(String 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"); 9. } 10. } 11. Which well be output: A.Doing it for l is 3 B.Doing it 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 platform 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 the follo wing 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. 11. 4. { 12. 13. 5. 14. 15. 6. 16. 17. 7. 18. 19. 8. 20. 21. 9. 22. 23. 10. 24. 25. 11. 26. 27. 12. 28. 29. 13. 30. 31. 14. 32. 33. 15. 34. 35. 16. 36. 37. 17. 38. 39. 18. 40. 41. 19. 42. 43. 20. 44. 45. 21. 46. 47. 22. } } return country; String country = (String)cctld.get(countryCode); // What should be inserted here { public String getCountry(String countryCode) // other methods …… } // more code…… cctld.put("au", "Australia"); cctld.put("uk", "United Kingdom"); cctld.put("in", "India"); cctld = new HashMap(); { public AssertTest() private HashMap cctld; A.assert countryCode != null; B.assert countryCode != null : "Country code can not be null" ; C.assert cctld != null : "No country code data is available"; D.assert cctld : "No country code data is available"; 10:在下述选项时,没有构 成死循环的程序是 A.int i=100 while (1) { i=i%100+1; if (i>100) break; } B.for (;;); 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) 4. 3) 5. 4) } Vector myVect; myVect = new Vector(); A.第二行的声明不会为变量 myVect 分配内存空间. B.第二行语句创建一个 Vector 类 对象. C.第三行语句创建一个 Vector 类对象. D.第三行语句为一个 Vector 类对象分配内 存空间 12:A class 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 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 syntax at point x 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; public 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 =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. 6. 7. 8. 9. 10. 11. 12. char digit = 'a'; for (int i = 0; i < 10; i++) { switch (digit) { case 'x' : { int j = 0; 13. 14. 15. 16. 17. 19. 20. 21. } } } System.out.println(j); default : { int j = 100; } 18. System.out.println(j); 22. int i = j; 23. System.out.println(i); 24. } 25. 26. Choices: A.100 will be printed 11 times. B.The code will not 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. 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:Which are not Java keywords 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:printf("**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 4. 5. { 6. 7. int i = 99; 8. 9. public void amethod() 10. 11. { 12. 13. 14. 15. 16. 17. 18. 19. { 20. 21. 22. 23. 24. 25. } 26. 27. public class Derived extends Base 28. 29. { 30. 31. int i = -1; 32. 33. 34. 35. public static void main(String argv[]) 36. 37. { 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. public void amethod() } b.amethod(); System.out.println(b.i); Base b = new Derived(); } amethod(); Base() } System.out.println("Base.amethod()"); 48. 49. { 50. 51. 52. 53. 54. 55. } 56. 57. Choices: } System.out.println("Derived.amethod()"); A.Derived.amethod() -1 Derived.amethod() B.Derived.amethod() 99 C.Compile time error D.Derived.amethod() 简答题 22:怎样在复杂的各种形式的网页中提取 mp3 下载的 结构化数据 23:编写一程序,利用 RandomAccessFile 类将一个文件的全部内容追加到另一 个文件的末尾. 24:已知 abc+cba=1333,其中 a,b,c 均为一位数,编程求出满足条件的 a,b,c 所有组合. 25:servlet 的生命周期 26:Static Inner Class 和 Inner Class 的不同, 说得越多越好. 27:如果有几千个 session,怎么提高效率. 28: 1. public class Something { 2. 3. 4. 5. 6. } 7. 有错吗 29:是否可以从一个 static 方法内部发出对非 static 方 法的调用 30:error 和 exception 有什么区别 31:Is Tomcat faster than serving static HTML pages than Apache httpd } void doSomething () { private String s = ""; int l = s.length(); 西安三元数码软件有限公司 外派 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.private 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; 8. a=b; 9. System.out.println(a); 10. } 11. In the absence of compiler optimization, which is the earliest point the object a refere d 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="Example String";Which operation is not legal A.int i=s.length(); B.s[3]="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(String 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"); 9. } 10. } 11. Which well be output: A.Doing it for l is 3 B.Doing it 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 platform 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 the follo wing 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. 11. 4. { 12. 13. 5. 14. 15. 6. 16. 17. 7. 18. 19. 8. 20. 21. 9. 22. 23. 10. 24. 25. 11. 26. 27. 12. 28. 29. 13. 30. 31. 14. 32. 33. 15. 34. 35. 16. 36. 37. 17. 38. 39. 18. 40. 41. 19. 42. 43. 20. 44. 45. 21. 46. 47. 22. } } return country; String country = (String)cctld.get(countryCode); // What should be inserted here { public String getCountry(String countryCode) // other methods …… } // more code…… cctld.put("au", "Australia"); cctld.put("uk", "United Kingdom"); cctld.put("in", "India"); cctld = new HashMap(); { public AssertTest() private HashMap cctld; A.assert countryCode != null; B.assert countryCode != null : "Country code can not be null" ; C.assert cctld != null : "No country code data is available"; D.assert cctld : "No country code data is available"; 10:在下述选项时,没有构 成死循环的程序是 A.int i=100 while (1) { i=i%100+1; if (i>100) break; } B.for (;;); 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) 4. 3) 5. 4) } Vector myVect; myVect = new Vector(); A.第二行的声明不会为变量 myVect 分配内存空间. B.第二行语句创建一个 Vector 类 对象. C.第三行语句创建一个 Vector 类对象. D.第三行语句为一个 Vector 类对象分配内 存空间 12:A class 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 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 syntax at point x 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; public 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 =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. 6. 7. 8. 9. 10. 11. 12. char digit = 'a'; for (int i = 0; i < 10; i++) { switch (digit) { case 'x' : { int j = 0; 13. 14. 15. 16. 17. 19. 20. 21. } } } System.out.println(j); default : { int j = 100; } 18. System.out.println(j); 22. int i = j; 23. System.out.println(i); 24. } 25. 26. Choices: A.100 will be printed 11 times. B.The code will not 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. 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:Which are not Java keywords 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:printf("**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 4. 5. { 6. 7. int i = 99; 8. 9. public void amethod() 10. 11. { 12. 13. 14. 15. 16. 17. 18. 19. { 20. 21. 22. 23. 24. 25. } 26. 27. public class Derived extends Base 28. 29. { 30. 31. int i = -1; 32. 33. 34. 35. public static void main(String argv[]) 36. 37. { 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. public void amethod() } b.amethod(); System.out.println(b.i); Base b = new Derived(); } amethod(); Base() } System.out.println("Base.amethod()"); 48. 49. { 50. 51. 52. 53. 54. 55. } 56. 57. Choices: } System.out.println("Derived.amethod()"); A.Derived.amethod() -1 Derived.amethod() B.Derived.amethod() 99 C.Compile time error D.Derived.amethod() 简答题 22:怎样在复杂的各种形式的网页中提取 mp3 下载的 结构化数据 23:编写一程序,利用 RandomAccessFile 类将一个文件的全部内容追加到另一 个文件的末尾. 24:已知 abc+cba=1333,其中 a,b,c 均为一位数,编程求出满足条件的 a,b,c 所有组合. 25:servlet 的生命周期 26:Static Inner Class 和 Inner Class 的不同, 说得越多越好. 27:如果有几千个 session,怎么提高效率. 28: 1. public class Something { 2. 3. 4. 5. 6. } 7. 有错吗 29:是否可以从一个 static 方法内部发出对非 static 方 法的调用 30:error 和 exception 有什么区别 31:Is Tomcat faster than serving static HTML pages than Apache httpd } void doSomething () { private String s = ""; int l = s.length();
本文档为【java工程师面试题2】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_833902
暂无简介~
格式:doc
大小:40KB
软件:Word
页数:0
分类:
上传时间:2017-09-30
浏览量:12