A class that implements java.io.Externalizable
is a class that provides a way to customize the serialization and deserialization,
allowing greater control over how the object’s state is written or read.
The first step of the deserialization process is to call the class' no-argument constructor before the readExternal(ObjectInput in)
method.
An implicit default no-argument constructor exists on a class when no constructor is explicitly defined within the class. But this implicit
constructor does not exist when any constructor is explicitly defined, and in this case, we should always ensure that one of the constructors has
no-argument.
It is an issue if the implicit or explicit no-argument constructor is missing or not public, because the deserialization will fail and throw an
InvalidClassException: no valid constructor.
.