| Author |
why "serialVersionUID" is used??
|
jacob deiter
Ranch Hand
Joined: Apr 02, 2008
Posts: 576
|
|
IN a servlet why the parameter is used??
private static final long "serialVersionUID";
|
 |
Marco Ehrentreich
best scout
Bartender
Joined: Mar 07, 2007
Posts: 1221
|
|
Hi Jacob,
according to the API documentation the class HttpServlet (not the Servlet interface) implements Serializable and for this it should declare a serialVersionUID. The name for this attribute has to be exactly like this for serialization to find it. It's primarily used by the serialization mechanism in Java to distinguish different versions of a class. So the programmer should change this UID in case of changes to the class if there are already serialized versions of this class used somewhere.
Just search on the web for more information on serialization in Java
Marco
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
More details here.
|
 |
 |
|
|
subject: why "serialVersionUID" is used??
|
|
|