Documentation Contents

Externalization with an Externalizable SuperClass


When using the Externalizable interface, an externalizable object must implement a writeExternal method to save the state of the object and a readExternal method to restore the state of the object. The externalizable object must also coordinate with its supertype to save and restore its state.

This example demonstrates how an object saves and restores the state of its externalizable supertype. When the supertype of an externalizable object is also externalizable, the subclass object calls the writeExternal and readExternal methods of its superclass in its own writeExternal and readExternal methods.

blue bar

Additional Information:

Source Files
Running the Example
List of Examples

Oracle and/or its affiliates Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.
Contact Us