Serializing an object with static property
Serialization is often used to convert the in memory objects to stream and vice-versa. But static members are not part the object states so they are not serialized in this process. You need to serialize an object that has some static properties. The answer is, you need to control the process of serialization and De-Serialization for those objects. To do this in java you need to implement the interface Externalizable. This is similar to the Serializable interface but with more control…