单选题Given: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.// insert code here 16.} 17.} and this element in the web application’s deployment descriptor: 302 /html/error.html Which,inserted at line 15,causes the container to redirect control to the error.html resource?()Aresponse.setError(302);Bresponse.sendError(302);Cresponse.setStatus(302);Dresponse.sendRedirect(302);Eresponse.sendErrorRedirect(302);
单选题
Given: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.// insert code here 16.} 17.} and this element in the web application’s deployment descriptor: 302 /html/error.html Which,inserted at line 15,causes the container to redirect control to the error.html resource?()
A
response.setError(302);
B
response.sendError(302);
C
response.setStatus(302);
D
response.sendRedirect(302);
E
response.sendErrorRedirect(302);
参考解析
解析:
暂无解析
相关考题:
下列哪个类声明是正确的?A.abstract class G2 extends superClassl,superClass2{……}B.abstract public class classmates{……}C.public final class NewClass extends superClass implements Interfacel{……}D.public abstract class String{……}
定义一个类名为“MyClass.java”的类,并且该类可被一个工程中的所有类访问,那么该类的正确声明应为 ( )A.private class MyClass extends ObjectB.class UyClass extends ObjectC.public class MyClassD.private class MyClass extends Object
下列类头定义中,错误的是( )。 A.class x { .... }B.public x extends y { .... }C.public class x extends y { .... }D.class x extends y implements y1 { .... }
Given:What can directly access and change the value of the variable name?() A. any classB. only the Target classC. any class in the test packageD. any class that extends Target
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 MinMaxN extends Object {D.public class MinMaxN extends Number {E.public class MinMax? extends Object {F.public class MinMaxN extends Integer {
如果有-个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
现有两个类A,B,以下描述中表示B继承自A的是 ( )A.class A extends BB.class B implements AC.class A implements BD.class B extends A
如果有一个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
定义一个类名为MyClass的类,并且该类可被所有类访问,那么该类的正确声明应为()A、private class MyClass extends ObjectB、class MyClass extends ObjectC、public class MyClassD、protected class MyClass extends Object
Servlet的基本架构public class ServletName extends HttpServlet {public void doPost(HttpServletRequest request, HttpServletResponse response) throwsServletException, IOException {}public void doGet(HttpServletRequest request, HttpServletResponse response) throwsServletException, IOException {}}1、用String的方法将数据类型转换为String。
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、B,以下描述中表示B继承自A的是()A、class A extends BB、class B implements AC、class A implementsD、class B extends A
定义一个类名为"MyClass.java"的类,并且该类可被一个工程中的所有类访问,那么该类的正确声明应为()。A、private class My Class extends ObjectB、class My Class extends ObjectC、public class My ClassD、public class My Class extends Object
现自: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下足六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译? () A、 0B、 1C、 2D、 3
下列类的定义中,错误的是()。A、class x{....}B、public x extends y{....}C、public class x extends y{....}D、class x extends y implements y1{....}
What produces a compiler error?() A、 class A { public A(int x) {} }B、 class A {} class B extends A { B() {} }C、 class A { A() {} } class B { public B() {} }D、 class Z { public Z(int) {} } class A extends Z {}
多选题Given: 10. interface Jumper { public void jump(); } ... 20. class Animal {} ... 30. class Dog extends Animal { 31. Tail tail; 32. } ... 40. class Beagle extends Dog implements Jumper{ 41. public void jump() {} 42. } ... 50. class Cat implements Jumper{ 51. public void jump() {} 52. }. Which three are true?()ACat is-a JumperBCat is-a AnimalCDog is-a JumperDDog is-a AnimalEBeagle has-a JumperFCat has-a AnimalGBeagle has-a Tail
多选题定义一个类名为"MyClass.java"的类,并且该类可被一个工程中的所有类访问,那么该类的正确声明应为()。Aprivate class My Class extends ObjectBclass My Class extends ObjectCpublic class My ClassDpublic class My Class extends Object
多选题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?()AA user whose role is Admin can perform a PUT.BA user whose role is Admin can perform a GET.CA user whose role is Admin can perform a POST.DA user whose role is Member can perform a PUT.EA user whose role is Member can perform a POST.FA user whose role is Member can perform a GET.
单选题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*/ } }
单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()Aany classBonly the Target classCany class in the test packageDany class that extends Target
单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()Aany classBonly the Target classCany class in the test packageDany class that extends Target
多选题Which two demonstrate an “is a” relationship?()Apublic interface Person { } public class Employee extends Person { }Bpublic interface Shape { } public class Employee extends Shape { }Cpublic interface Color { } public class Employee extends Color { }Dpublic class Species { } public class Animal (private Species species;)Einterface Component { } Class Container implements Component ( Private Component[ ]children; )
多选题Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;
单选题现自: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下足六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译? ()A 0B 1C 2D 3
单选题What produces a compiler error?()A class A { public A(int x) {} }B class A {} class B extends A { B() {} }C class A { A() {} } class B { public B() {} }D class Z { public Z(int) {} } class A extends Z {}
单选题Given the definition of MyServlet: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.HttpSession session = request.getSession(); 16.session.setAttribute("myAttribute","myAttributeValue"); 17.session.invalidate(); 18.response.getWriter().println("value=" + 19.session.getAttribute("myAttribute")); 20.} 21.} What is the result when a request is sent to MyServlet?()AAn IllegalStateException is thrown at runtime.BAn InvalidSessionException is thrown at runtime.CThe string value=null appears in the response stream.DThe string value=myAttributeValue appears in the response stream.