The InvalidClassException occurs when the Serialization runtime detects a problem with a class. The problem can be one of the following:

  • The serial version of the class does not match that of the class descriptor read from the stream.
  • The class contains unknown data types.
  • The class does not have an accessible constructor without arguments.


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Java on Codecademy