SCWCD(310-083)

多选题Given: 3.class MyServlet extends HttpServlet { 4.public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { 5.// servlet code here ... 26.} 27.} If the DD contains a single security constraint associated w

题目
多选题
Given: 3.class MyServlet extends HttpServlet { 4.public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { 5.// servlet code here ... 26.} 27.} If the DD contains a single security constraint associated with MyServlet and its only  tagsand  tags are:GETPUT Admin Which four requests would be allowed by the container?()
A

A user whose role is Admin can perform a PUT.

B

A user whose role is Admin can perform a GET.

C

A user whose role is Admin can perform a POST.

D

A user whose role is Member can perform a PUT.

E

A user whose role is Member can perform a POST.

F

A user whose role is Member can perform a GET.

参考答案和解析
正确答案: F,D
解析: 暂无解析
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Servlet的基本架构

public class ServletName extends HttpServlet {

public void doPost(HttpServletRequest request, HttpServletResponse response) throws

ServletException, IOException {

}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws

ServletException, IOException {

}

}

1、用String的方法将数据类型转换为String。


正确答案:

 

1、String.valueOf(1.23)

第2题:

Given the web application deployment descriptor elements: 11. 12.ParamAdder 13.com.example.ParamAdder 14.... 24. 25.ParamAdder 26.MyServlet 27. 28. Which element, inserted at line 27,causes the ParamAdder filter to be applied when MyServlet is invokedby another servlet using the RequestDispatcher.include method?()

  • A、<include/>
  • B、<dispatcher>INCLUDE</dispatcher>
  • C、<dispatcher>include</dispatcher>
  • D、<filter-condition>INCLUDE</filter-condition>
  • E、<filter-condition>include</filter-condition>

正确答案:B

第3题:

Given:Which two, inserted at line 11, will allow the code to compile?()

A.public class MinMax<?> {

B.public class MinMax<? extends Number> {

C.public class MinMax<N extends Object> {

D.public class MinMax<N extends Number> {

E.public class MinMax<? extends Object> {

F.public class MinMax<N extends Integer> {


参考答案:D, F

第4题:

1.public class Test {  2.public static void main (String args[]) {  3.class Foo {  4.public int i = 3;  5.}  6.Object o = (Object) new Foo();  7.Foo foo = (Foo)o;  8.System.out.printIn(foo. i); 9. }  10.}   What is the result?()  

  • A、 Compilation will fail.
  • B、 Compilation will succeed and the program will print “3”
  • C、 Compilation will succeed but the program will throw a ClassCastException at line 6.
  • D、 Compilation will succeed but the program will throw a ClassCastException at line 7.

正确答案:B

第5题:

Given the following interface definition, which definitions are valid?()   interface I {   void setValue(int val);   int getValue();   }    DEFINITION a:   (a) class a extends I {  int value;   void setValue(int val) { value = val;  }   int getValue() {  return value;  }   }   DEFINITION b:   (b) interface b extends I {   void increment();   }   DEFINITION c:   (c) abstract class c implements I {   int getValue() {  return 0;  }  abstract void increment();   }   DEFINITION d:   (d) interface d implements I {  void increment();  }   DEFINITION e:   (e) class e implements I {  int value;   public void setValue(int val) { value = val; }  }  

  • A、Definition a.
  • B、Definition b.
  • C、Definition c.
  • D、Definition d.
  • E、Definition e.

正确答案:B,C

第6题:

public class TestA{    public void methodA() throws IOException{        //……    } }  public class TestB extends TestA{    public void methodA() throws EOFException{        //……   } }  public class TestC extends TestA{    public void methodA() throws Exception{        //……   } }  当编译类TestC的时候,结果是哪项?() 

  • A、 正常
  • B、 编译错误
  • C、 运行错误
  • D、 以上都不对

正确答案:B

第7题:

interface Data { public void load(); }  abstract class Info { public abstract void load(); }  Which class correctly uses the Data interface and Info class?() 

  • A、 public class Employee extends Info implements Data { public void load() { /*do something*/ } }
  • B、 public class Employee implements Info extends Data { public void load() { /*do something*/ } }
  • C、 public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }
  • D、 public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }
  • E、 public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }
  • F、 public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }

正确答案:A

第8题:

使下列程序正常运行并且输出“Hello!”,横线处应填写的内容是( )。 class Test { public static void main(string[]args){ Test t=new Test; start; } Public void run{ System.out.println("Hello!¨); )

A.extends Thread

B.extends Float

C.extends Iostream

D.extends Stdio


正确答案:A
A。【解析】从后面重写了run方法来看,这是通过继承Thread类,并重写run方法定义线程体,然后创建该子类的对象的方式来创建线程。

第9题:

Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()

  • A、 The attribute foo is placed in the application
  • B、 A ServletContextListener registered for that servlet is notified
  • C、 A ServletAttributeListener registered for that servlet is notified
  • D、 An HttpSessionAttributeListener registered for that servlet is notified

正确答案:A

第10题:

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

  • A、 public void foo() { /* more code here */ }
  • B、 private void foo() { /* more code here */ }
  • C、 protected void foo() { /* more code here */ }
  • D、 int foo() { /* more code here */ }  
  • E、 void foo() { /* more code here */ }

正确答案:A,C,E

更多相关问题