Learnitweb

Difference between Externalization and Serialization

Difference between Serialization and Externalization can be described with the help of following points:

SerializationExternalizable
Serializable is a marker interface.Externalizable is not a marker interface. Externalizable interface contains two methods writeExternal() and readExternal().
Serializable is for default serialization.The purpose of Externalizable is for customized serialization.
In case of serialization, the responsibility of serialization is on JVM.Externalization provides control of serialization to the programmer.
In case of serialization, complete object is saved. It is not possible to save part of the object.With externalization, it is possible to serialize part of an object.
Performance is low.Performance is relatively high in comparison to serialization because programmer has the control to save selected properties of object.
It is not required to have a no-arg constructor in a Serializable.It is required for an Externalizable class to have a public no-arg constructor.
transient keyword affects serialization.transient keyword has not role to play in Externalization.