0 votes
1 view
in Java by (10.2k points)
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?

1 Answer

0 votes
by (46.1k points)

As far as I can explain, that would be only for harmony with previous releases. This would only be beneficial if you overlooked to use a serialVersionUID before, and then made a switch that you know should be compatible but which produces serialization to break.

Check the Java Serialization Spec for more details.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !