dcsimg

What things are required for a class that implements Externalizable?

Tim Rohaly

A class that implements Externalizable must also:

  • Have a public, no-argument constructor.
  • Provide a writeExternal(ObjectOutput) method to save the state of the object, including the state of any superclass, to the ObjectOutput stream.
  • Provide a readExternal(ObjectInput) method to restore the state of the object, including the state of any superclass, from the ObjectInput stream.