全省北京宇信易诚科技有限公司招聘JAVA笔试模拟题及答案-考试专题训练

上传人:lil****n07 文档编号:139123131 上传时间:2022-08-22 格式:DOC 页数:10 大小:246.22KB
返回 下载 相关 举报
全省北京宇信易诚科技有限公司招聘JAVA笔试模拟题及答案-考试专题训练_第1页
第1页 / 共10页
全省北京宇信易诚科技有限公司招聘JAVA笔试模拟题及答案-考试专题训练_第2页
第2页 / 共10页
全省北京宇信易诚科技有限公司招聘JAVA笔试模拟题及答案-考试专题训练_第3页
第3页 / 共10页
点击查看更多>>
资源描述
北京宇信易诚科技有限公司招聘JAVA笔试真题及答案选择题 1:鉴于Java的特点,它最适合的计算环境是bA.并行计算环境 B.分布式计算环境 C.高强度计算环境 D.开放式计算环境 2:Which method you define as the starting point of new thread in a class from which new the thread can be excution? bA.public void start() B.public void run() C.public void runnable() D.public static void main(String args) 3:Which statement about listener is true? A 什么是ListenerA.Most component allow multiple listeners to be added. B.If multiple listener be add to a single component, the event only affected one listener. C.Component don?t allow multiple listeners to be add. D.none 4:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序? aA.计划阶段、开发阶段、运行阶段 B.设计阶段、开发阶段、编码阶段 C.设计阶段、编码阶段、维护阶段 D.计划阶段、编码阶段、测试阶段 5: b 1. Whatwillbeprintedwhenyouexecutethefollowingcode? 2. 3. classX 4. 5. Yb=newY(); 6. X() 7. 8. System.out.print(X); 9. 10. 11. 12. classY 13. 14. Y() 15. 16. System.out.print(Y); 17. 18. 19. 20. publicclassZextendsX 21. 22. Yy=newY(); 23. Z() 24. 25. System.out.print(Z); 26. 27. publicstaticvoidmain(Stringargs) 28. 29. newZ(); 30. 31. 32. 33. Choices:What will be printed when you execute the following code? class X Y b = new Y(); X() System.out.print(X); class Y Y() System.out.print(Y); public class Z extends X Y y = new Y(); Z() System.out.print(Z); public static void main(String args) new Z(); Choices:A.Z B.YZ C.XYZ D.YXYZ 6: c1. Givethefollowingmethod: 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, 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 7: c1. Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode? 2. 3. (Assumethatthecodeiscompiledandrunwithassertionsenabled) 4. 5. 1.importjava.util.*; 6. 7. 2. 8. 9. 3.publicclassAssertTest 10. 11. 4. 12. 13. 5.privateHashMapcctld; 14. 15. 6. 16. 17. 7.publicAssertTest() 18. 19. 8. 20. 21. 9.cctld=newHashMap(); 22. 23. 10.cctld.put(in,India); 24. 25. 11.cctld.put(uk,UnitedKingdom); 26. 27. 12.cctld.put(au,Australia); 28. 29. 13./morecode. 30. 31. 14. 32. 33. 15./othermethods. 34. 35. 16.publicStringgetCountry(StringcountryCode) 36. 37. 17. 38. 39. 18./Whatshouldbeinsertedhere? 40. 41. 19.Stringcountry=(String)cctld.get(countryCode); 42. 43. 20.returncountry; 44. 45. 21. 46. 47. 22.Which is the most appropriate code snippet that can be inserted at line 18 in the following code?(Assume that the code is compiled and run with assertions enabled)1. import java.util.*;2. 3. public class AssertTest4. 5. private HashMap cctld;6. 7. public AssertTest()8. 9. cctld = new HashMap();10. cctld.put(in, India);11. cctld.put(uk, United Kingdom);12. cctld.put(au, Australia);13. / more code. 14. 15. / other methods . 16. public String getCountry(String countryCode)17. 18. / What should be inserted here?19. String country = (String)cctld.get(countryCode);20. return country;21. 22. 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; 8:Which declares for native method in a java class corrected? bA.public native void method() B.public native void method(); C.public native method(); D.public void native method(); 9: d1. Whatwillbetheresultofexecutingthefollowingcode? 2. 3. publicstaticvoidmain(Stringargs) 4. 5. chardigit=a; 6. for(inti=0;i10;i+) 7. 8. switch(digit) 9. 10. casex: 11. 12. intj=0; 13. System.out.println(j); 14. 15. default: 16. 17. intj=100; 18. System.out.println(j); 19. 20. 21. 22. inti=j; 23. System.out.println(i); 24. 25. 26. Choices:What will be the result of executing the following code? public static void main(String args) char digit = a; for (int i = 0; i 0) 8. System.out.println(“Finish”); 9. 10. 11. Whichwellbeoutput:Give the following code:public class Examplepublic static void main(String args )int l=0;doSystem.out.println(“Doing it for l is:”+l);while(-l0)System.out.println(“Finish”);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 13:Use the operator “” and “”. Which statement is true? bA.1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 1010 0000 0000 0000 0000 0000 0000 B.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 C.1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 0000 0000 0000 0000 0000 0000 0000 D.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 14:Which statements about Java code security are not true? aA.The bytecode verifier loads all classes needed for the execution of a program. B.Executing code is performed by the runtime interpreter. C.At runtime the bytecodes are loaded, checked and run in an interpreter. D.The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources. 15: b1. 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. 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 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 void amethod() System.out.println(Derived.amethod(); Choices:A.Derived.amethod() -1 Derived.amethod() B.Derived.amethod() 99 C.Compile time error D.Derived.amethod() 简答题 16:写clone()方法时,通常都有一行代码,是什么?Super.clone() 17:整数转换为字符串。 int MyInt = 1234; String MyString = + MyInt;18:不用中间变量,实现int a,b的交换。 Int a , b ;a = a+b;b = a-b;a = a-b;19:lucene的底层数据结构。 20:单个的hibernate session可以跨越多个数据库事务吗? 21:统计一个字符串中字符出现的次数。public class CharCounterpublic static int counter(String s,char c)int count=0;for(int i=0;is.length();i+)if(s.charAt(i)=c)count+;return count;public static void main(String args)System.out.println(new CharCounter().counter(LOVELOVEYOU,O); 22:servlet的生命周期? Servlet的生命周期分为5个阶段:实例化:Servlet容器创建Servlet类的实例。初始化:该容器调用init()方法,通常会申请资源。服务:由容器调用service()方法,(也就是doGet()和doPost())。破坏:在释放Servlet实例之前调用destroy()方法,通常会释放资源。不可用:释放内存的实例。23:hibernate中,一个操作单元的范围是多大? 24:假设现有一个单向的链表,但是只知道只有一个指向该节点的指针p,并且假设这个节点不是尾节点,试编程实现删除此节点。 25:如果要设计一个图形系统,请你设计基本的图形元件(Point,Line,Rectangle,Triangle)的简单实现。 26:With tomcat,Show me a simple cluster configuration example。 27:写一段Jdbc连mysql,或者Oracle的程序,并实现数据查询。 Class.forName( org.gjt.mm.mysql.Driver ); cn = DriverManager.getConnection( jdbc:mysql:/MyDbComputerNameOrIP:3306/myDatabaseName, sUsr, sPwd );
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


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