how-to

Classes

How to use "serialver" tool (serialver.exe) ?

Every serializable class is in time of deserialization identified by its hash. The synonymum for this value is serialVersionUID.

When you want to read class hash code, use tool serialver.exe. It is in your \java\jdk\bin directory. I recommend you set this directory into your system path variable.

When I have this class (saved in Person.class file):

import java.io.Serializable;

public class Person implements Serializable {
          
  public Person() {}
      
  String name;
  int age;      
}

, then I can read class serialVersionUID.

When I do small change:

import java.io.Serializable;

public class Person implements Serializable {

  public Person() {}

  String name;
  int age1;
}

, returned value is other.