NotSerializableException
NotSerializableException is a runtime exception in Java that occurs when an object is attempted to be serialized, but the object's class or one of its superclasses does not implement the java.io.Serializable interface. Serialization is the process of converting an object's state into a byte stream, which can then be saved to a file or transmitted over a network. Deserialization is the reverse process, where the byte stream is used to reconstruct the object.
For an object to be serializable, its class must explicitly declare that it implements the Serializable interface.
When an attempt is made to serialize an object that is not serializable, the Java serialization mechanism