public void valueUnbound(HttpSessionEvent ev){...}
public void sessionPassivated(HttpSessionEvent ev){...}
public void sessionDidActivate(HttpSessionEvent ev){...}
public void sessionWillPassivate(HttpSessionEvent ev){...}
第1题:
Which three are described in the standard web application deployment descriptor?()
第2题:
public class ExceptionTest { class TestException extends Exception {} public void runTest () throws TestException {} public void test () /* Point X*/ { runTest (); } } At point X on line 4, which code can be added to make the code compile?()
第3题:
interface A { public int getValue() } class B implements A { public int getValue() { return 1; } } class C extends B { // insert code here } Which three code fragments, inserted individually at line 15, make use of polymorphism?()
第4题:
Which the statement is true about web container session management()?
第5题:
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?()
第6题:
You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a thread that accepts a single integer parameter. You write the following code segment (Line numbers are included for reference only.) Thread myThread = new Thread(new ParameterizedThreadStart(DoWork)) ; myThread.Start(100); You need to declare the method signature of the DoWork method. Which method signature should you use?()
第7题:
args.count
args.length
args.count()
args.length()
args.getLength()
第8题:
Insert the following code at line 02. [DataContractFormat()] Insert the following code at line 22. [DataMember()]
Insert the following code at line 02. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAtttibute()]
Insert the following code at line 09. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAttribute()]
Insert the following code at line 19. [DataContractFormat()] Insert the following code at line 22. [DataMember()]
第9题:
public void add(C c) { c.getValue(); }
public void add(B b) { b.getValue(); }
public void add(A a) { a.getValue(); }
public void add(A a, B b) { a.getValue(); }
public void add(C c1, C c2) { c1.getValue(); }
第10题:
The line marked (1).
The line marked (2).
The line marked (3).
The line marked (4).
The line marked (5).
第11题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第12题:
public void valueUnbound(HttpSessionEvent ev){...}
public void sessionPassivated(HttpSessionEvent ev){...}
public void sessionDidActivate(HttpSessionEvent ev){...}
public void sessionWillPassivate(HttpSessionEvent ev){...}
第13题:
1. public class A { 2. public void method1() { 3. B b=new B(); 4. b.method2(); 5. // more code here 6. } 7. } 1. public class B { 2. public void method2() { 3.C c=new C(); 4. c.method3(); 5. // more code here 6. } 7. } 1. public class C { 2. public void method3() { 3. // more code here 4. } 5. } Given: 25. try { 26. A a=new A(); 27. a.method1(); 28. } catch (Exception e) { 29. System.out.print(”an error occurred”); 30. } Which two are true if a NullPointerException is thrown on line 3 of class C?()
第14题:
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:
第15题:
Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object. class Base { public void print( ) { System.out.println("base"); } } class Extention extends Base { public void print( ) { System.out.println("extension"); // insert line of implementation here } } public class Q294d { public static void main(String args[]) { Extention ext = new Extention( ); ext.print( ); } } Fill in a single line of implementation.()
第16题:
Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () public class Q76a9 { static String f() { String a = "hello"; String b = "bye"; // (0) String c = b + "!"; // (1) String d = b; b = a; // (2) d = a; // (3) return c; // (4) } public static void main(String args[]) { String msg = f(); System.out.println(msg); // (5) } }
第17题:
You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.The WCF service contains the following code segment. (Line numbers are included for reference only.) 01 [ServiceContract( )] 02 03 public interface IEmployeeService 04 { 05 [OperationContract( )] 06 EmployeeInfo GetEmployeeInfo(int employeeID); 07 08 } 09 10 public class EmployeeService : IEmployeeService 11 { 12 13 public EmployeeInfo GetEmployeeInfo(int employeeID) 14 { 15 ... 16 } 17 } 18 19 20 public class EmployeeInfo 21 { 22 ... 23 public int EmployeeID { get; set; } 24 public string FirstName { get; set; } 25 public string LastName { get; set; } 26 27 }The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.You need to ensure that applications can consume the service without code changes in the client. What should you do?()
第18题:
args.count
args.length
args.count()
args.length()
args.getLength()
第19题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第20题:
A
B
C
D
E
F
第21题:
Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.
第22题:
Hello
Hello Foo
Hello world
Compilation fails.
The code does not run.
第23题:
Throws Exception.
Catch (Exception e).
Throws RuntimeException.
Catch (TestException e).
No code is necessary.
第24题:
response.setError(302);
response.sendError(302);
response.setStatus(302);
response.sendRedirect(302);
response.sendErrorRedirect(302);