What is Externalizable in Java



Externalization is used whenever we need to customize serialization mechanism. If a class implements an Externalizable interface then, object serialization will be done using writeExternal() method.

Whereas at receiver’s end when an Externalizable object is a reconstructed instance will be created using no argument constructor and then the readExternal() method is called.

If a class implements only Serializable interface object serialization will be done using ObjectoutputStream.

At the receiver’s end, the serializable object is reconstructed using ObjectInputStream.

Updated on: 2019-07-30T22:30:20+05:30

185 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements