• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Using serialVersionUID ...

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenver we have to implement the Seriazable interface we have to define a private member of "long" type for interoperateablity. This member is "serialVersionUID" .
What is the criteria to set this final member , I mean what value we have to set for this ?
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It needs to be a long. You can make one up. Incompatible versions of the same class should have different values. If you make a change to a class that would alter the way it would be serialized [i.e., add a field], you should change the UID.

If you need to find the uid of an existing class you can use the java utility serialver. The command is:

serialver [-classpath classpath] [-show] [classname...]
[ December 27, 2006: Message edited by: Scott Johnson ]
 
Md. Mohd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Scott Johnson
Thanks for valuable feedback.Also go for the link http://www-03.ibm.com/developerworks/blogs/page/woolf?entry=serialization_and_serial_version_uid

Thanks
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!