填空题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.()

相似考题
更多“填空题3. string foo = “ABCDE”;  4. foo.substring(3);   5. foo.concat(“XYZ”);   6.   Type the value of foo at line 6.()”相关问题
  • 第1题:

    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

  • 第2题:

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


    正确答案:BASE

  • 第3题:

    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

  • 第4题:

    2. public class Foo implements Runnable (  3. public void run (Thread t) {  4. system.out.printIn(“Running.”);  5. }  6. public static void main (String[] args)  {  7. new thread (new Foo()).start(); 8. )  9. )   What is the result?()      

    • A、 An exception is thrown.
    • B、 The program exists without printing anything.
    • C、 An error at line 1 causes compilation to fail.
    • D、 An error at line 6 causes the compilation to fail.
    • E、 “Running” is printed and the program exits.

    正确答案:C

  • 第5题:

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


    正确答案:ABCDE

  • 第6题:

    Given  1.  public class Foo {  2.  public static void main (String [] args) }  3.  try { return;}  4.  finally { Syste.out.printIn (“Finally”);}  5. }  6. }   What is the result( )?

    • A、 The program runs and prints nothing.
    • B、 The program runs and prints “Finally”.
    • C、 The code comiles. But an exception is thrown at runtime.
    • D、 The code will not compile because the catch block is missing.

    正确答案:B

  • 第7题:

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

    正确答案: BASE
    解析: 暂无解析

  • 第8题:

    单选题
    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
    解析: 暂无解析

  • 第9题:

    单选题
    int index = 1;  String [] test = new String[3];  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
    解析: 暂无解析

  • 第10题:

    单选题
    2. public class Foo implements Runnable (  3. public void run (Thread t) {  4. system.out.printIn(“Running.”);  5. }  6. public static void main (String[] args)  {  7. new thread (new Foo()).start(); 8. )  9. )   What is the result?()
    A

     An exception is thrown.

    B

     The program exists without printing anything.

    C

     An error at line 1 causes compilation to fail.

    D

     An error at line 6 causes the compilation to fail.

    E

     “Running” is printed and the program exits.


    正确答案: C
    解析: 暂无解析

  • 第11题:

    单选题
    public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   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
    解析: 暂无解析

  • 第12题:

    单选题
    Which retrieves the value associated with “foo” from within an HttpServlet?()
    A

     String value = getServletConfig( ).getParameter(“foo”);

    B

     String value = getServletContext( ).getAttribute(“foo”);

    C

     Object value = getServletContext( ).getInitParameter(“foo”);

    D

     String value = getServletContext( ).getInitParameter(“foo”)


    正确答案: D
    解析: 暂无解析

  • 第13题:

    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

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

    Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()

    • A、String x = (String) pageContext.getAttribute("foo")
    • B、String x = (String) pageContext.getRequestScope("foo")
    • C、It is NOT possible to access the pageContext object from within doStartTag
    • D、String x = (String) pageContext.getRequest().getAttribute("foo")
    • E、String x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)

    正确答案:D

  • 第17题:

    public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   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

  • 第18题:

    int index = 1;  String [] test = new String[3];  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

  • 第19题:

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

    正确答案: ABCDE
    解析: 暂无解析

  • 第20题:

    单选题
    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
    解析: 暂无解析

  • 第21题:

    填空题
    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
    解析: 暂无解析

  • 第22题:

    单选题
    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


    正确答案: A
    解析: 暂无解析

  • 第23题:

    多选题
    Given: 6. 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)}


    正确答案: C,B
    解析: 暂无解析

  • 第24题:

    单选题
    Given the JSP code: and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
    A

    String x = (String) pageContext.getAttribute(foo)

    B

    String x = (String) pageContext.getRequestScope(foo)

    C

    It is NOT possible to access the pageContext object from within doStartTag

    D

    String x = (String) pageContext.getRequest().getAttribute(foo)

    E

    String x = (String) pageContext.getAttribute(foo, PageContext.ANY_SCOPE)


    正确答案: B
    解析: 暂无解析