On Saturday 20 November 2004 08:16, Vadim Gritsenko wrote:

> No! "1" is not "The stream-unique identifier".

Vadim, I don't know where you get that 1L wouldn't work... But it does (and I 
kind of know what I am talking about).

The serialVersionUID is used to determine the compatibility between a loaded 
class and the serialized object of such class. There is not much more to it.

The serialver executable is provided so that you can figure out the 
serialVerUID after the fact of releasing your code first time.

So, i.e. you can use any number you want, and your challenge is to figure out 
when the number needs to be changed, i.e. serialization compatibility is no 
longer possible.

To that effect, by not using writeObject()/readObject() it will indeed be 
slightly more tricky to maintain the serialization compatibility. With those 
methods, it shouldn't be too hard to maintain compatibitity almost forever.

Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+

Reply via email to