| Author |
Why HttpServlet also implements Serializable?
|
Kousik Majumder
Ranch Hand
Joined: Sep 30, 2007
Posts: 219
|
|
Hi all, As we know that if any of the super class implements an interface then the descending classes need not use to implement the interface. So why HttpServlet implements Serializable interface where as it extends GenericServlet and GenericServlet implements Serializable ? Thanks, Kousik SCJP 5
|
Thanks in Advance,
Kousik
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Probably just clarity. It makes no difference to remove it, but this way they're saying "please note that this class really is serializable".
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
By making the servlet serializable, the builders of the servlet API insure that the implementers have the option of serializing the servlet for persistence or load balancing.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Why HttpServlet also implements Serializable?
|
|
|