欢迎来到天天文库
浏览记录
ID:58965535
大小:37.50 KB
页数:5页
时间:2020-10-27
《东华软件笔试题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、北京东华合创数码科技股份有限公司笔试试卷(Java语言部分)姓名:联系方式:1.whichwon’tcauseacompilerwarningorerror?(多选)a)floatf=1.3;b)charc=‘a’;c)byteb=257;d)booleanb=null;e)inti=10;2.请选择下面这段代码的输出结果?inti=0;switch(i){case0:System.out.println("zero");case1:System.out.println("one");case2:
2、System.out.println("two");break;case3:System.out.println("three");}1)zero2)zero,one3)zero,one,two4)zero,one,two,three3.publicclassTest{privatestaticintj=0;publicstaticbooleanmethodB(intk){j+=k;returntrue;}publicstaticvoidmethodA(inti){booleanb;b=i>10&
3、methodB(1);b=i>10&&methodB(2);}publicstaticvoidmain(Stringargs){methodA(0);17)}}whatisthevalueofjatline17?1)02)13)24)34.Ifweexecutethecodebelowwith“javaTestRedGreenBlue”,whatistheresult?publicclassTest{publicstaticvoidmain(String[]args){Stringfoo=args
4、[1];Stringbar=args[2];Stringbaz=args[3];}}whatisthevalueofbaz?A.bazhasvalueof""B.bazhasvalueofnullC.bazhasvalueof"Red"D.bazhasvalueof"Blue"E.bazhasvalueof"Green"F.thecodedoesnotcompileG.theprogramthrowanexception5.请选择下面这段代码的输出结果?1)publicclassTest{2)pu
5、blicstaticvoidmain(String[]args){3)classFoo{4)publicinti=3;5)}6)Objecto=(Object)newFoo();7)Foofoo=(Foo)o;8)System.out.println(foo.i);9)}10)}A.compileerroratline6B.compileerroratline7C.compileerroratline8D.printout36.intindex=1;String[]test=newString[3
6、];Stringfoo=test[index];whatistheresultoffoo?A.""B.nullC.throwaExceptionD.notcompile7.下面的五个选择中哪两个描述是正确的?(多选)A.staticinnerclassrequiresastaticinitializerB.AstaticinnerclassrequiresaninstanceoftheenclosingclassC.Astaticinnerclasshasnoreferencetoaninstan
7、ceoftheenclosingclassD.Astaticinnerclasshasaccessstothenon-staticmemberoftheotherclassE.staticmembersofastaticinnerclasscanbereferencedusingtheclassnameofthestaticinnerclass8.请选择下面这段代码的输出结果?classA{publicintgetNumber(inta){returna+1;}}classBextendsA{pu
8、blicintgetNumber(inta,charc){returna+2;}publicstaticvoidmain(String[]args){Bb=newB();System.out.println(b.getNumber(0));}}A.compilationsucceedsand1isprintedB.compilationsucceedsand2isprintedC.Anerroratline8causecompilationtofailD.Anerroratline
此文档下载收益归作者所有