Gaurangkumar Khalasi wrote:
gurpeet singh wrote:you cannod do ServletConfig sc = new GenericServlet() as well as new HttpServlet(); since both GenericServlet and HttpServlet are abstract classes.
Maybe with anonymous inner class definition of those abstract classes!!...
for that correct syntax would have been ServletConfig sc = new GenericServlet(){ }; and not ServletConfig sc = new GenericServlet();
but i think we are deviating from the original topic , which is as to WHY generic servlet implements ServletConfig. the clever answer would be thats how the spec implementors thought of GenericServlet class which abstracts Servlet Functionality