第1题:
1. public class Test { 2. public static void main (String args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()
第2题:
Given: 6.<% int[] nums = {42, 420, 4200}; 7.request.setAttribute("foo", nums); %> Which two successfully translate and result in a value of true?()
第3题:
GiventheJSPcode:<%request.setAttribute("foo","bar");%>andtheClassictaghandlercode:5.publicintdoStartTag()throwsJspException{6.//insertcodehere7.//returnint8.}Assumetherearenoother"foo"attributesinthewebapplication.WhichinvocationonthepageContextobject,insertedatline6,assigns"bar"tothevariablex?()
A.Stringx=(String)pageContext.getAttribute("foo")
B.Stringx=(String)pageContext.getRequestScope("foo")
C.ItisNOTpossibletoaccessthepageContextobjectfromwithindoStartTag
D.Stringx=(String)pageContext.getRequest().getAttribute("foo")
E.Stringx=(String)pageContext.getAttribute("foo",PageContext.ANY_SCOPE)
第4题:
1. class SuperFoo { 2. SuperFoo doStuff(int x) { 3. return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 下面哪三项分别插入到第8行,可以编译?()
第5题:
5. String foo = “base”; 6. foo.substring(0,3); 7. foo.concat(“ket”) 8. Type the value of foo at line 8.()
第6题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第7题:
1. public class Test { 2. public static String output =””; 3. 4. public static void foo(int i) { 5. try { 6. if(i==1) { 7. throw new Exception(); 8. } 9. output += “1”; 10. } 11. catch(Exception e) { 12. output += “2”; 13. return; 14. } 15. finally { 16. output += “3”;17. } 18. output += “4”; 19. } 20. 21. public static void main(String args[]) { 22. foo(0); 23. foo(1); 24. 25. }26. } What is the value of the variable output at line 23?()
第8题:
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
第9题:
1. interface foo { 2. int k = 0; 3. } 4. 5. public class test implements Foo ( 6. public static void main(String args[]) ( 7. int i; 8. Test test = new test (); 9. i= test.k; 10.i= Test.k; 11.i= Foo.k; 12.) 13.) 14. What is the result?()
第10题:
String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()