The SerialVersionUID is used as part of Serialization/de-Serialization. Its purpose is to ensure that when the object will not be deserialized if the SerialVersionUID’s dont match. If the ID’s dont match then a java.io.InvalidClassException is thrown.
The SerialVersionUID must be static, final, long and preferably private – eg private static final long serialVersionUID = 1L;
It can be generated by –
The key to using any of these approaches is to be consistent, and be sure to update it as the class changes