• Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract class HttpServlet question  RSS feed

 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

If the HttpServlet class is an abstract one. Then how is that we are overriding only some do_xxx methods (to make it a concrete class )instaed of all methods in the HttpServlet ?


Regards
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you only need to implement the abstract methods to make a concrete class, not all methods. If you look at the API, none of the doXXX methods are abstract, so while you should override atleast one, you are not forced to override them all.
 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,

That means If only there are any abstract methods in the abstract class ,only then we require overriding/redefining.



Thanks
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shaan patil:
Ok,

That means If only there are any abstract methods in the abstract class ,only then we require overriding/redefining.



Thanks


Yes, very much!
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me, it looks like you are confusing Java Abstract Classes with Java Interfaces. Its a good time to go back and brush up your Java skills.

Cheers.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adeel Ansari:
To me, it looks like you are confusing Java Abstract Classes with Java Interfaces. Its a good time to go back and brush up your Java skills.

Cheers.


Good point.
Moving to Java In General (Intermediate).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!