There are 3 ways to define the serialVersionUID :
1. private static final long serialVersionUID = 1L; (Default)
2. private static final long serialVersionUID = -
The value is used while serializing an object and de-serializing the object back into JVM.
Further, If your class changes and you don't want to support backward compatibility (i.e. able to de-serialize the object back which was serialized using your last version of class) you can change the version number to any other value.
However, to support the backward compatibility you need to keep the same version number as previously set value of serialVersionUID.
The best practice is to change the serialVersionUID, every time you have some incompatible changes to the class.