网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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.()” 相关考题
考题 GiventheJSPcode:%request.setAttribute(foo,bar);%andtheClassictaghandlercode:5.publicintdoStartTag()throwsJspException{6.//insertcodehere7.//returnint8.}Assumetherearenootherfooattributesinthewebapplication.WhichinvocationonthepageContextobject,insertedatline6,assignsbartothevariablex?()A.Stringx=(String)pageContext.getAttribute(foo)B.Stringx=(String)pageContext.getRequestScope(foo)C.ItisNOTpossibletoaccessthepageContextobjectfromwithindoStartTagD.Stringx=(String)pageContext.getRequest().getAttribute(foo)E.Stringx=(String)pageContext.getAttribute(foo,PageContext.ANY_SCOPE)

考题 publicclassDelta{staticbooleanfoo(charc){System.out.print(c);returntrue;}publicstaticvoidmain(String[]argv){inti=0;for(foo(‘A’);foo(‘B’)(i2);foo(‘C’)){i++;foo(‘D’);}}}Whatistheresult?() A.ABDCBDCBB.ABCDABCDC.Compilationfails.D.Anexceptionisthrownatruntime.

考题 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 nullC、 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.

考题 public class Test {   public static void main (String args) {  string foo = “blue”;  string bar = foo;   foo = “green”;   System.out.printIn(bar);   }   }   What is the result?()  A、 An exception is thrown.B、 The code will not compile.C、 The program prints “null”D、 The program prints “blue”E、 The program prints “green”

考题 public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?() A、 foofoofoofoofooB、 foobarfoobarbarC、 foobarfoofoofooD、 foobarfoobarfooE、 barbarbarbarbarF、 foofoofoobarbarG、 foofoofoobarfoo

考题 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 nullC、 An exception is thrownD、 The code will not compile

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

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

考题 public class Delta {  static boolean foo(char c) {  System.out.print(c);  return true;  }  public static void main( String[] argv ) {  int i =0;  for ( foo(‘A’); foo(‘B’)(i2); foo(‘C’)){  i++ ;  foo(‘D’);  }  }  }  What is the result?()  A、 ABDCBDCBB、 ABCDABCDC、 Compilation fails.D、 An exception is thrown at runtime.

考题 public class Test {  public static void main(String args[]) {  class Foo {  public int i = 3; }  Object o = (Object)new Foo();   Foo foo = (Foo)o;  System.out.println(“i = “ + foo.i); }  }  What is the result?()  A、 i = 3B、 Compilation fails.C、 A ClassCastException is thrown at line 6.D、 A ClassCastException is thrown at line 7.

考题 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 doStartTagD、String x = (String) pageContext.getRequest().getAttribute("foo")E、String x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)

考题 String foo = “blue”;    Booleanbar = 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.

考题 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 nullC、 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.

考题 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 nullC、 An exception is thrownD、 The code will not compile

考题 单选题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 nullC  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.

考题 单选题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”)

考题 单选题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 nullC  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.

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

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

考题 单选题String foo = “blue”;    Booleanbar = 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.

考题 单选题public class Test {  public static void main (String [] args)  {  string foo = “blue”;  string bar = foo;  foo = “green”;  System.out.printIn(bar);  }  }   What is the result?()A  An exception is thrown.B  The code will not compile.C  The program prints “null”D  The program prints “blue”E  The program prints “green”

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

考题 多选题public class Foo {   private int val;   public foo(int v) (val = v;) }   public static void main (String args) {   Foo a = new Foo (10);   Foo b = new Foo (10);   Foo c = a;   int d = 10;   double e = 10.0;   }   Which three logical expression evaluate to true? ()A(a ==c)B(d ==e)C(b ==d)D(a ==b)E(b ==c)F(d ==10.0)

考题 单选题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 nullC  An exception is thrownD  The code will not compile

考题 单选题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 nullC  An exception is thrownD  The code will not compile

考题 单选题public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?()A  foofoofoofoofooB  foobarfoobarbarC  foobarfoofoofooD  foobarfoobarfooE  barbarbarbarbarF  foofoofoobarbarG  foofoofoobarfoo

考题 填空题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 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 doStartTagD String x = (String) pageContext.getRequest().getAttribute(foo)E String x = (String) pageContext.getAttribute(foo, PageContext.ANY_SCOPE)