serialVersionUID
is actually the version number of this class his serialisation. You need to change the number when you don't have backwards compability. The serialisation add the serialnumber to the serialised data. While deserialisation it will look at FQN and the serialVersionUID
for correctness of the class, if not correct => ClassCastException
. This means that 1L
is indeed sufficient. If you don't use the Serialisation
, it's actually even not needed to set it(But of course it's better to set it).
-
FEATURED COMPONENTS