CONTENTS | PREV | NEXT Java Object Serialization Specification


1.10 The Serializable Interface

Object Serialization produces a stream with information about the Java(tm) classes for the objects that are being saved. For serializable objects, sufficient information is kept to restore those objects even if a different (but compatible) version of the implementation of the class is present. The interface Serializable is defined to identify classes that implement the serializable protocol:

package java.io;

public interface Serializable {};
The class of a serializable object must do the following:

The class of a serializable object can also implement the following:

ObjectOutputStream and ObjectInputStream are designed and implemented to allow the serializable classes they operate on to evolve. Evolve in this context means to allow changes to the classes that are compatible with the earlier versions of the classes. Details of the mechanism to allow compatible changes can be found in Section 5.5, "Compatible Java(tm) Type Evolution."



CONTENTS | PREV | NEXT
Copyright © 1997-1998 Sun Microsystems, Inc. All Rights Reserved.