Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
第1题:
public class Employee{ private String name; public Employee(String name){ this.name = name; } public String getName(){ return name; } } public class Manager extends Employee{ private String department; public Manager(String name,String department){ this.department = department; super(name); (应于上一行掉位置) System.out.println(getName()); } } Super的位置是否在方法的首行 执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?()
第2题:
Which three demonstrate an “is a” relationship?()
第3题:
public class Employee{ private String name; public Employee(String name){ this.name = name; } public String getName(){ return name; } } public class Manager extends Employee{ private String department; public Manager(String name,String department){ this.department = department; super(name); System.out.println(getName()); } } 执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?()
第4题:
Which the two demonstrate an “is a” relationship?()
第5题:
interface Beta {} class Alpha implements Beta { String testIt() { return “Tested”; } } public class Main1 { static Beta getIt() { return new Alpha(); } public static void main( String[] args ) { Beta b = getIt(); System.out.println( b.testIt() ); } } What is the result?()
第6题:
You are developing a Hotel Booking application for a travel company. The users request a wizard-style interface for this application. How could you satisfy this requirement?()
第7题:
public interface B extends A {}
public interface B implements A {}
public interface B instanceOf A {}
public interface B inheritsFrom A {}
第8题:
Reference the Object Iron packages in your form module.
Write an HTML interface, and invoke it from your form module.
Include the Wizard class reusable component in your application.
Build a customized wizard using tab canvases and a horizontal toolbar canvas.
第9题:
Tested
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第10题:
A
B
C
D
第11题:
Public void mouseMoved(MouseEvent)
Public boolean mouseMoved(MouseEvent)
Public void mouseMoved(MouseMotionEvent)
Public boolean MouseMoved(MouseMotionEvent)
Public boolean mouseMoved(MouseMotionEvent)
第12题:
Use the following code to declare the FindAttribute method: public T FindAttribute (T att) {//Find attribute and return the value }
Use the following code to declare the FindAttribute method: public object FindAttribute (object att) {//Find attribute and return the value }
Use the following code to declare the FindAttribute method: public T FindAttribute
Use the following code to declare the FindAttribute method: public string FindAttribute (string att) {//Find attribute and return the value }
第13题:
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?()
第14题:
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface: public interface ApplicationController {public String invoke(HttpServletRequest request)} The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext. Which code snippet of the FrontController servlet accomplishes this goal?()
第15题:
Which is a method of the MouseMotionListener interface?()
第16题:
Which two demonstrate an “is a” relationship?()
第17题:
You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()
第18题:
You work as an application developer at Certkiller .com. You are currently in the process of creating a class that stores data about Certkiller .com’s customers. Certkiller .com customers are assigned unique identifiers and various characteristics that may include aliases, shipping instructions, and sales comments. These characteristics can change in both size and data type. You start by defining the Customer class as shown below: public class Customer { private int custID; private ArrayList attributes; public int CustomerID { get {return custID;} } public Customer (int CustomerID) { this.custID = CustomerID; this.attributes = new ArrayList (); } public void AddAttribute (object att) { attributes.Add (att); } } You have to create the FindAttribute method for locating attributes in Customer objects no matter what the data type is.You need to ensure that the FindAttributemethod returns the attribute if found,and you also need to ensure type-safety when returning the attribute.What should you do?()
第19题:
Compilation fails because of an error in line 3.
Compilation fails because of an error in line 7.
Compilation fails because of an error in line 9.
If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.
If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.
If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
第20题:
Your filter class must implement an init method and a destroy method.
Your filter class must also implement javax.servlet.FilterChain.
When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.
The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.
Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.
第21题:
smith
null
SALES
编译错误
第22题:
An IllegalStateException is thrown at runtime.
An InvalidSessionException is thrown at runtime.
The string value=null appears in the response stream.
The string value=myAttributeValue appears in the response stream.
第23题:
Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
第24题:
smith
null
SALES
编译错误