预览加载中,请您耐心等待几秒...
1/4
2/4
3/4
4/4

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

华为Java面试题华为Java面试题第一部分:选择题QUESTIONNO:11、publicclassTest{publicstaticvoidchangeStr(Stringstr){str="welcome";}publicstaticvoidmain(String[]args){Stringstr="1234";changeStr(str);System.out.println(str);}}pleasewritetheoutputresult:QUESTIONNO:21.publicclassTest{2.staticbooleanfoo(charc){3.System.out.print(c);4.returntrue;5.}6.publicstaticvoidmain(String[]argv){7.inti=0;8.for(foo(A);foo(B)&&(i9.i++;10.foo(D);12.}13.}14.}Whatistheresult?A.ABDCBDCBB.ABCDABCDC.Compilationfails.D.Anexceptionisthrownatruntime.QUESTIONNO:31.classA{2.protectedintmethod1(inta,intb){return0;}3.}WhichtwoarevalidinaclassthatextendsclassA?(Choosetwo)A.publicintmethod1(inta,intb){return0;}B.privateintmethod1(inta,intb){return0;}C.privateintmethod1(inta,longb){return0;}D.publicshortmethod1(inta,intb){return0;}E.staticprotectedintmethod1(inta,intb){return0;}QUESTIONNO:41.publicclassOuter{2.publicvoidsomeOuterMethod(){3.//Line34.}5.publicclassInner{}6.publicstaticvoidmain(String[]argv){7.Outero=newOuter();8.//Line89.}10.}WhichinstantiatesaninstanceofInner?A.newInner();//Atline3B.newInner();//Atline8C.newo.Inner();//Atline8D.newOuter.Inner();//Atline8//newOuter().newInner()QUESTIONNO:5WhichmethodisusedbyaservlettoplaceitssessionIDinaURLthatiswrittentotheservlet’sresponseoutputstream?A.TheencodeURLmethodoftheHttpServletRequestinterface.B.TheencodeURLmethodoftheHttpServletResponseinterface.C.TherewriteURLmethodoftheHttpServletRequestinterface.D.TherewriteURLmethodoftheHttpServletResponseinterface.QUESTIONNO:6Whichtwoareequivalent?(Choosetwo)A.