ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:20.86KB ,
资源ID:6997577      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6997577.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Java开发工程师 笔试题.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Java开发工程师 笔试题.docx

1、Java开发工程师 笔试题选择题 1:Which of the following statements are not legal? A.long l = 4990; B.int i = 4L; C.double d = 34.4; D.double t = 0.9F. 2: Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? publicclassStatic static intx=5; staticintx,y; publicstaticvoidmain(Stringargs) x-; myMethod(); Sys

2、tem.out.println(x+y+x); publicstaticvoidmyMethod() y=x+x; Choices:What will happen when you attempt to compile and run the following code? public class Staticstaticint x = 5; static int x,y;public static void main(String args) x-; myMethod(); System.out.println(x + y + +x); public static void myMeth

3、od()y = x+ + +x; Choices:A.prints : 2 B.prints : 3 C.prints : 7 D.prints : 8 3: Givethecodefragment: if(x4) System.out.println(“Test1”); elseif(x9) System.out.println(“Test2”); else System.out.println(“Test3”); Whichrangeofvaluexwouldproduceofoutput“Test2”?Give the code fragment:if(x4)System.out.pri

4、ntln(“Test 1”);else if (x9)System.out.println(“Test 2”);else System.out.println(“Test 3”);Which range of value x would produce of output “Test 2”? A.x4 C.x9 D.None 4:Math.round(-11.5)等於多少? A.-11 B.-12 C.-11.5 D.none 5:public class Parent int change() class Child extends Parent Which methods can be a

5、dded into class Child? A.public int change() B.abstract int chang() C.private int change() D.none 6:在软件生命周期中,下列哪个说法是不准确的? A.软件生命周期分为计划、开发和运行三个阶段 B.在计划阶段要进行问题焉醛和需求分析 C.在开发后期要进行编写代码和软件测试 D.在运行阶段主要是进行软件维护 7: Givethefollowingjavaclass: publicclassExample publicstaticvoidmain(Stringargs) staticintx=newin

6、t15; System.out.println(x5); Whichstatementiscorrected?Give the following java class:public class Examplepublic static void main(String args)static int x = new int15;System.out.println(x5);Which statement is corrected?A.When compile, some error will occur. B.When run, some error will occur. C.Output

7、 is zero. D.Output is null. 8:假定a和b为int型变量,则执行下述语句组后,b的值为 a=1; b=10; do b-=a; a+; while (b-0); A.9 B.-2 C.-1 D.8 9:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序? A.计划阶段、开发阶段、运行阶段 B.设计阶段、开发阶段、编码阶段 C.设计阶段、编码阶段、维护阶段 D.计划阶段、编码阶段、测试阶段 10: Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? classBas

8、e inti=99; publicvoidamethod() System.out.println(Base.amethod(); Base() amethod(); publicclassDerivedextendsBase inti=-1; publicstaticvoidmain(Stringargv) Baseb=newDerived(); System.out.println(b.i); b.amethod(); publicvoidamethod() System.out.println(Derived.amethod(); Choices:What will happen whe

9、n 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(); publi

10、c 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() 11: Givethisclassoutline: classExample privateintx; /restofclassbody AssumingthatxinvokedbythecodejavaExample,whichstatementcanmadex

11、bedirectlyaccessibleinmain()methodofExample.java?Give this class outline:class Exampleprivate int x;/rest of class bodyAssuming 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

12、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 12: Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode? (Assumethatthecodeiscompiledandrunwithassertionsenabled) 1.importjava.util.*; 2. 3.publicclassAssertTest

13、4. 5.privateHashMapcctld; 6. 7.publicAssertTest() 8. 9.cctld=newHashMap(); 10.cctld.put(in,India); 11.cctld.put(uk,UnitedKingdom); 12.cctld.put(au,Australia); 13./morecode. 14. 15./othermethods. 16.publicStringgetCountry(StringcountryCode) 17. 18./Whatshouldbeinsertedhere? 19.Stringcountry=(String)c

14、ctld.get(countryCode); 20.returncountry; 21. 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. publ

15、ic 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(

16、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; 13: 给出下面的代码片断。下面的哪些陈述为错误的? 1)publicvoidcreate() 2)Vector

17、myVect; 3)myVect=newVector(); 4)给出下面的代码片断。下面的哪些陈述为错误的?1) public void create() 2) Vector myVect;3) myVect = new Vector();4) A.第二行的声明不会为变量myVect分配内存空间。 B.第二行语句创建一个Vector类对象。 C.第三行语句创建一个Vector类对象。 D.第三行语句为一个Vector类对象分配内存空间 14: Givethefollowingjavasourcefragement: /pointx publicclassInteresting /dosomet

18、hing WhichstatementiscorrectlyJavasyntaxatpointx?Give the following java source fragement:/point xpublic class Interesting/do somethingWhich 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 15:Which statemen

19、t about listener is true? A.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 16: publicclassX publicObjectm() Objecto=newFloat(3.14F);/line3 Obj

20、ectoa=newObject1;/line4 oa0=o;/line5 o=null;/line6 returnoa0;/line7 WhenistheFloatobject,createdinline3,eligibleforgarbagecollection?public class X public Object m() Object o = new Float(3.14F);/line 3 Object oa = new Object1;/line 4 oa0 = o;/line 5 o=null;/line 6 return oa0;/line 7 When is the Floa

21、t object, created in line 3,eligible for garbage collection?A.just after line 5. B.just after line 6 C.just after line 7(that is,as the method returns) D.never in this method 17: Whatwillbeprintedwhenyouexecutethefollowingcode? classX Yb=newY(); X() System.out.print(X); classY Y() System.out.print(Y

22、); publicclassZextendsX Yy=newY(); Z() System.out.print(Z); publicstaticvoidmain(Stringargs) newZ(); 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.o

23、ut.print(Z); public static void main(String args) new Z(); Choices:A.Z B.YZ C.XYZ D.YXYZ 简答题 18:swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上? 19:Static Inner Class 和 Inner Class的不同,说得越多越好。 20:请说出你所知道的线程同步的方法。 21:一堆数在一个集合中,总共2n个,问如何将这些数分成A,B两分,每分n个,要求A中的数均小于B中的数,需要考虑时间复杂度。 22: packagetest; publicclass

24、FatherClass publicFatherClass() System.out.println(FatherClassCreate); 子类: packagetest; importtest.FatherClass; publicclassChildClassextendsFatherClass publicChildClass() System.out.println(ChildClassCreate); publicstaticvoidmain(Stringargs) FatherClassfc=newFatherClass(); ChildClasscc=newChildClass(); 输出结果:package test;public class FatherClasspublic FatherClass()Sy

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1