As we can override the default serialization process by overriding writeObject() and readObject() , then What is the need of Externalizable interface?
Class implementing Serializable
may or may not wish to change the format in which the instance of that class, written into the stream.
But, Class implementing Externalizable
must implement writeExternal
and readExternal
methods, and its the class's responsibility to write and restore the data to/from the stream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With