1、第一部分:选择题QUESTIONNO:11、public class Test { public static void changeStr(String str){ str="welcome"; } public static void main(String[] args) { String str="1234"; changeStr(str); System.out.println(str); }}Pleasewritetheoutputresult:QUESTI
2、ONNO:21. public class Test {2. static boolean foo(char c) {3. System.out.print(c);4. return true;5. }6. public static void main( String[] argv ) {7. int i =0;8. for ( foo('A'); foo('B')&&(i<2); foo('C')){9. i++ ;10. foo('D');12. }13. }14. }Whatistheresult?A.ABDCBDCBB.ABCDABCDC
3、.Compilationfails.D.Anexceptionisthrownatruntime.QUESTIONNO:31. class A {2. protected int method1(int a, int b) { return 0; }3. }WhichtwoarevalidinaclassthatextendsclassA?(Choosetwo)A.publicintmethod1(inta,intb){return0;}B.privateintmethod1(inta,intb){return0;}C.privateintmeth
4、od1(inta,longb){return0;}D.publicshortmethod1(inta,intb){return0;}E.staticprotectedintmethod1(inta,intb){return0;}QUESTIONNO:41. public class Outer{2. public void someOuterMethod() {3. // Line 34. }5. public class Inner{}6. public static void main( String[]argv ) {7. Outer o =
5、 new Outer();8. // Line 89. }10. }WhichinstantiatesaninstanceofInner?A.newInner();//Atline3B.newInner();//Atline8C.newo.Inner();//Atline8D.newOuter.Inner();//Atline8//newOuter().newInner()QUESTIONNO:5WhichmethodisusedbyaservlettoplaceitssessionIDinaURLthatiswrittentotheservlet