aspose file tools
The moose likes Beginning Java and the fly likes why Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "why "serialVersionUID" is used??" Watch "why "serialVersionUID" is used??" New topic
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
    
    4
More details here.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: why "serialVersionUID" is used??
 
Similar Threads
serialversionUID in CMP bean
ArrayList problem ...
What is "serialVersionUID"
serial
serialVersionUID ??