I am using the serialized classes in java and in those classes I need to specify the serialVersionUID with some long number to be initialized. As a default it takes as
private static final long serialVersionUID = 1L;
Or else I can initialize the same with some other long number too, like as bellow:
private static final long serialVersionUID = 5561040348988016571L;
some very big number.
My question is: Does it really matter which value we initialize to serialVersionUID or not?
My question is does this really matters which value we initialize to serialVersionUID or it doesn't matter.
No, it doesn't matter, unless you already have existing serializations (e.g. files) that were made before you added this member. In that case you must use the value output by the serialver utility when run on the .class file as it was when those serializations were made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With