I have been browsing the source code of Tomcat and would like to know why the javax.servlet.HTTPServlet class has a non abstract implementation of the doGet, doPost, etc methods. Why not just declare them abstract ? I mean HTTPServlet is an abstract class so why take the trouble to write implementations in HTTPServlet ? Isn’t it better to just mark them as abstract methods ?
The default methods obviously do nothing until they are overridden, wouldn't it be cleaner code if they were abstract ? Regards Sreyan Chakravarty