wood burning stoves 2.0*
The moose likes Servlets and the fly likes GenericServlet Vs HttpServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "GenericServlet Vs HttpServlet" Watch "GenericServlet Vs HttpServlet" New topic
Author

GenericServlet Vs HttpServlet

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi,

GenericServlet class implements Serializable interface.
HttpServlet extends Genericservlet implements Serializable interface. Becuase HttpServlet extends GenericServlet, HttpServlet will be automatically implements Serializable interface know.. Why API says HttpServlet implementes Serializable interface also. I feel it is kind of duplicate. Please advice..Thanks


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Just because a base class is serializable doesn't guarantee that a subclass might not include non-serializable elements.


Customer surveys are for companies who didn't pay proper attention to begin with.
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi Tom, Can you please make your statement simple. I am not clear. Thanks
Tim Holloway wrote:Just because a base class is serializable doesn't guarantee that a subclass might not include non-serializable elements.
 
Consider Paul's rocket mass heater.
 
subject: GenericServlet Vs HttpServlet
 
Similar Threads
Why HttpServlet implements Serializable interface
is Serialization Inherited
need advice
extending a class which implements Serializable
Why HttpServlet also implements Serializable?