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

题目内容 (请给出正确答案)
单选题
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)


参考答案

参考解析
解析: 暂无解析
更多 “单选题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)” 相关考题
考题 Given:fooandbararepublicreferencesavailabletomanyotherthreads,fooreferstoaThreadandbarisanObject.Thethreadfooiscurrentlyexecutingbar.wait().Fromanotherthread,whatprovidesthemostreliablewaytoensurethatfoowillstopexecutingwait()?()A.foo.notify();B.bar.notify();C.foo.notifyAll();D.Thread.notify();E.bar.notifyAll();F.Object.notify();

考题 ClicktheExhibitbutton.Given:11.%com.example.Advisoradvisor=newcom.example.Advisor();%12.%request.setAttribute(foo,advisor);%Assumingtherearenootherfooattributesinthewebapplication,whichthreearevalidELexpressionsforretrievingtheadvicepropertyofadvisor?()A.${foo.advice}B.${request.foo.advice}C.${requestScope.foo.advice}D.${requestScope[foo[advice]]}E.${requestScope[foo][advice]}

考题 Given:Which three methods, inserted individually at line 14, will correctly complete class Two?() A.int foo() { /* more code here */ }B.void foo() { /* more code here */ }C.public void foo() { /* more code here */ }D.private void foo() { /* more code here */ }E.protected void foo() { /* more code here */ }

考题 Given:Which code, inserted at line 15, allows the class Sprite to compile?() A.Foo { public int bar() { return 1; }B.new Foo { public int bar() { return 1; }C.new Foo() { public int bar() { return 1; }D.new class Foo { public int bar() { return 1; }

考题 Given:fooandbararepublicreferencesavailabletomanyotherthreads.fooreferstoaThreadandbarisanObject.Thethreadfooiscurrentlyexecutingbar.wait().Fromanotherthread,whatprovidesthemostreliablewaytoensurethatfoowillstopexecutingwait()?A.foo.notify();B.bar.notify();C.foo.notifyAll();D.Thread.notify();E.bar.notifyAll();

考题 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”

考题 Which code determines the int value foo closest to a double value bar?()  A、 Int foo = (int) Math.max(bar);B、 Int foo = (int) Math.min(bar);C、 Int foo = (int) Math.abs(bar);D、 Int foo = (int) Math.ceil(bar);E、 Int foo = (int) Math.floor(bar);F、 Int foo = (int) Math.round(bar);

考题 Which JSTL code snippet can be used to perform URL rewriting?()A、a href=’c:url url="foo.jsp"/’ /B、a href=’c:link url="foo.jsp"/’ /C、a href=’c:url value="foo.jsp"/’ /D、a href=’c:link value="foo.jsp"/’ /

考题 Given:  foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait().  From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()A、foo.notify();B、bar.notify();C、foo.notifyAll();D、Thread.notify();E、bar.notifyAll();F、Object.notify();

考题 Which the JSTL code snippet can be used to import content from another web resource?()A、 c:import url=*foo.jsp”/ B、 c:import page=*foo.jsp”/ C、 c:include url=*foo.jsp”/ D、 c:include page=*foo.jsp”/ E、 Importing cannot be done in JSTL. A standard action must be used instead.

考题 A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()A、prefix:myTag a="foo" b="bar" c="baz" /B、prefix:myTag attributes={"foo","bar","baz"} /C、prefix:myTag jsp:attribute a="foo" b="bar" c="baz" /D、prefix:myTagjsp:attribute name="a"foo/jsp:attributejsp:attribute name="b"bar/jsp:attributejsp:attribute name="c"baz/jsp:attribute. /prefix:myTag

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

考题 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)

考题 public class Foo {  public int a;  public Foo() { a = 3; }  public void addFive() { a += 5; }  }  and:  public class Bar extends Foo { public int a;  public Bar() { a = 8; }  public void addFive() { this.a +=5; }  }  invoked with:  Foo foo = new Bar();  foo.addFive();  System.out.println(”Value: “+ foo.a);  What is the result?() A、 Value: 3B、 Value: 8C、 Value: 13D、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.

考题 Given: foo and bar are public references available to many other threads. foo refers to a Thread and bar is anObject.  The thread foo is currently executing bar.wait().  From another thread,what provides the most reliable wayto ensure that foo will stop executing wait()?A、foo.notify();B、bar.notify();C、foo.notifyAll();D、Thread.notify();E、bar.notifyAll();

考题 单选题public class Foo {  public int a;  public Foo() { a = 3; }  public void addFive() { a += 5; }  }  and:  public class Bar extends Foo { public int a;  public Bar() { a = 8; }  public void addFive() { this.a +=5; }  }  invoked with:  Foo foo = new Bar();  foo.addFive();  System.out.println(”Value: “+ foo.a);  What is the result?()A  Value: 3B  Value: 8C  Value: 13D  Compilation fails.E  The code runs with no output.F  An exception is thrown at runtime.

考题 多选题Given:   10. class One {   11. void foo() { }   12. }   13. class Two extends One {   14. //insert method here   15. }   Which three methods, inserted individually at line 14, will correctly complete class Two?()Apublic void foo() { /* more code here */ }Bprivate void foo() { /* more code here */ }Cprotected void foo() { /* more code here */ }Dint foo() { /* more code here */ }Evoid foo() { /* more code here */ }

考题 多选题Given: Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }

考题 多选题A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()Aprefix:myTag a=foo b=bar c=baz /Bprefix:myTag attributes={foo,bar,baz} /Cprefix:myTag jsp:attribute a=foo b=bar c=baz /Dprefix:myTagjsp:attribute name=afoo/jsp:attributejsp:attribute name=bbar/jsp:attributejsp:attribute name=cbaz/jsp:attribute. /prefix:myTag

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

考题 单选题Which code determines the int value foo closest to, but not greater than, a double value bar?()A  Int foo = (int) Math.max(bar);B  Int foo = (int) Math.min(bar);C  Int foo = (int) Math.abs(bar);D  Int foo = (int) Math.ceil(bar);E  Int foo = (int) Math.floor(bar);F  Int foo = (int) Math.round(bar);

考题 单选题10. interface Foo { int bar(); }  11. public class Sprite {  12. public int fubar( Foo foo) { return foo.bar(); }  13. public void testFoo() {  14. fubar(  15. // insert code here  16.);  17. }  18. }  Which code, inserted at line 15, allows the class Sprite to compile?()A  Foo { public int bar() { return 1; } }B  new Foo { public int bar() { return 1; } }C  newFoo() { public int bar(){return 1; } }D  new class Foo { public int bar() { return 1; } }

考题 单选题Which JSTL code snippet can be used to import content from another web resource?()A c:import url=foo.jsp/B c:import page=foo.jsp/C c:include url=foo.jsp/D c:include page=foo.jsp/

考题 单选题Given:  foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait().  From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()A foo.notify();B bar.notify();C foo.notifyAll();D Thread.notify();E bar.notifyAll();F Object.notify();

考题 单选题Which JSTL code snippet can be used to perform URL rewriting?()A a href=’c:url url=foo.jsp/’ /B a href=’c:link url=foo.jsp/’ /C a href=’c:url value=foo.jsp/’ /D a href=’c:link value=foo.jsp/’ /

考题 单选题Which the JSTL code snippet can be used to import content from another web resource?()A  c:import url=*foo.jsp”/ B  c:import page=*foo.jsp”/ C  c:include url=*foo.jsp”/ D  c:include page=*foo.jsp”/ E  Importing cannot be done in JSTL. A standard action must be used instead.

考题 单选题Given: foo and bar are public references available to many other threads. foo refers to a Thread and bar is anObject.  The thread foo is currently executing bar.wait().  From another thread,what provides the most reliable wayto ensure that foo will stop executing wait()?A foo.notify();B bar.notify();C foo.notifyAll();D Thread.notify();E bar.notifyAll();

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