Java InvalidClassException
Definition and Usage
An InvalidClassException happens during serialization (saving an object as bytes, for example in a file, and reading it back later). It is thrown when the class of the saved object does not match the class in the program, for example because the class was changed after the object was saved.
Classes that can be saved this way often have a serialVersionUID field (a version number for the class). If the number in the saved data is not the same as the number in the class, Java throws this exception. It is a kind of IOException.
Related Pages
Java Exceptions (try...catch) Tutorial
❮ Errors & Exceptions