If I write a serialversionUid for my class as say 1234, and I know that no other class in my program uses that, is that fine or do i always have to use a uid generated by the compiler?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
serialVersionUID can be any long that provides a unique signature to your object for serialization and deserialization. I don’t think it even have to be unique. This is so that the serializer knows that that is the same Foo.class even after you have change the structure of the class. I typically use a -1L for the value.