Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServlet

 
Gaia Nathan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I've been wondering for some time as to why the HttpServlet class in the javax.servlet.http package is declared abstract.
As far as I can see, it does not contain any abstract methods and has implemented the abstract "service" method in the GenericServlet class.
Can someone enlighten me on this? Thank you in advance.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class can have no abstract methods and still be declared abstract. It just means that the class was meant to be subclassed and not instatiated directly. This is the case for HttpServlet.
 
Gaia Nathan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Rick for that answer. I can sleep better now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic