填空题3. string foo = “ABCDE”;  4. foo.substring(3);   5. foo.concat(“XYZ”);   6.   Type the value of foo at line 6.()

题目
填空题
3. string foo = “ABCDE”;  4. foo.substring(3);   5. foo.concat(“XYZ”);   6.   Type the value of foo at line 6.()
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第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?()  

  • A、 -1
  • B、 255
  • C、 127
  • D、 Compilation will fail.
  • E、 Compilation will succeed but the program will throw an exception at line 4.

正确答案:D

第2题:

Given: 6.<% int[] nums = {42, 420, 4200}; 7.request.setAttribute("foo", nums); %> Which two successfully translate and result in a value of true?()

  • A、${true or false}
  • B、${requestScope[foo][0] > 500}
  • C、${requestScope[’foo’][1] = 420}
  • D、${(requestScope[’foo’][0] lt 50) && (3 gt 2)}

正确答案:A,D

第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)


参考答案:D

第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行,可以编译?()

  • A、int doStuff() { return 42; }
  • B、int doStuff(int x) { return 42; }
  • C、Foo doStuff(int x) { return new Foo(); }
  • D、SuperFoo doStuff(int x) { return new Foo(); }

正确答案:A,C,D

第5题:

5. String foo = “base”;   6. foo.substring(0,3);   7. foo.concat(“ket”)  8.   Type the value of foo at line 8.()


正确答案:BASE

第6题:

int index = 1;   String test = new String;   String foo = test[index];  What is the result?()

  • A、  Foo has the value “”
  • B、 Foo has the value null
  • C、 An exception is thrown
  • D、 The code will not compile

正确答案:B

第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?()


正确答案:13423

第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?()  

  • A、 Baz has the value of “”
  • B、 Baz has the value of null
  • C、 Baz has the value of “red”
  • D、 Baz has the value of “blue”
  • E、 Bax has the value of “green”
  • F、 The program throws an exception.

正确答案:F

第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?()  

  • A、 Compilation succeeds.
  • B、 An error at line 2 causes compilation to fail.
  • C、 An error at line 9 causes compilation to fail.
  • D、 An error at line 10 causes compilation to fail.
  • E、 An error at line 11 causes compilation to fail.

正确答案:A

第10题:

String foo = “blue”;  Boolean[]bar = new Boolean [1];  if (bar[0])  {  foo = “green”;  }   What is the result? () 

  • A、 Foo has the value of “”
  • B、 Foo has the value of null.
  • C、 Foo has the value of “blue”
  • D、 Foo has the value of “green”
  • E、 An exception is thrown.
  • F、 The code will not compile.

正确答案:F

更多相关问题