Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where's Servlet.service() method defined?  RSS feed

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
The Servlet interface declares a service() method.
Both GenericServlet and HttpServlet are abstract classes. Where's the service() method implemented?

Thanks,
Reema
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Reema Patel:
The Servlet interface declares a service() method ... Where's the service() method implemented?


The javadoc is your friend. It's defined in HttpServlet.

Both GenericServlet and HttpServlet are abstract classes.


Review your basic Java. Nothing prevents abstract classes from posessing concrete methods.
[ February 25, 2007: Message edited by: Bear Bibeault ]
 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thaks Bear!
yup, that
Nothing prevents abstract classes from posessing concrete methods.


Yup, quite true!
That's a key difference btw an interface and an bastract class; an abstract class can have concrete methods (methods with a body) while interfaces can't.

Thanks,
Reema
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!