Why generate long serialVersionUID instead of a simple 1L?

When class implements Serializable in Eclipse, I have two options: add default serialVersionUID(1L) or generated serialVersionUID(3567653491060394677L). I think that first one is cooler, but many times I saw people using the second option. Is there any reason to generate long serialVersionUID? 11 Answers 11

What does it mean: The serializable class does not declare a static final serialVersionUID field? [duplicate]

This question already has answers here: What is a serialVersionUID and why should I use it? (26 answers) Closed 4 years ago. I have the warning message given in the title. I would like to understand and remove it. I found already some answers on this question but I do not understand these answers because … Read more

What is a serialVersionUID and why should I use it?

Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare a static final serialVersionUID field of type long What is serialVersionUID and why is it important? Please show an example where missing serialVersionUID will cause a problem. 2 26 The docs for java.io.Serializable are probably about as good an explanation … Read more

What is a serialVersionUID and why should I use it?

The docs for java.io.Serializable are probably about as good an explanation as you’ll get: The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization. If … Read more