What does Serializable mean?

Ritwik Bose picture Ritwik Bose · Aug 7, 2010 · Viewed 95.5k times · Source

What exactly does it mean for a class to be Serializable in Java? Or in general, for that matter...

Answer

Oded picture Oded · Aug 7, 2010

Serialization is persisting an object from memory to a sequence of bits, for instance for saving onto the disk. Deserialization is the opposite - reading data from the disk to hydrate/create an object.

In the context of your question, it is an interface that if implemented in a class, this class can automatically be serialized and deserialized by different serializers.