Answer E Reason: GenericServlet has an abstract service(ServletRequest, ServletResponse) method. HttpServlet extends GenericServlet and provides a concrete implementation of the service() method. It also provides the empty implementation for the doXXX() methods. But the API says: Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
Is the answer E because the API is only saying you HAVE to override one of these to provide functionality, not to allow compilation? I dunno. Can anyone tell me?
Dave Not to be a smart a** but did you try it and see what it does? ?One thing I learned in the programmers test is to make sure you take the questions literally and dont read anything into them. In this case it is asking about if it will compile or not. Try not to read anything else into the question. By the way it will compile, but you'll get an error when you try to access it in a browser. Hope that helps