1.

How To Generate A Serialversionuid In Java?

Answer»

There are 3 ways to create a SERIALVERSIONUID value.

Using serialVer command bundled with JDK, pass the serializable class name as command parameter to get its version identifier.

Using Eclipse IDE, hover at the class and from the context menu CHOOSE Add default serial version ID, or Add GENERATED serial version ID.

Assign your own value and POSTFIX with 'L'.

private static final long serialVersionUID = 19L;

There are 3 ways to create a serialVersionUID value.

Using serialVer command bundled with JDK, pass the serializable class name as command parameter to get its version identifier.

Using Eclipse IDE, hover at the class and from the context menu choose Add default serial version ID, or Add generated serial version ID.

Assign your own value and postfix with 'L'.

private static final long serialVersionUID = 19L;



Discussion

No Comment Found