🍡serializable
Serializable is a marker interface in Java123456. It is used to indicate that a class can be serialized, which means its state can be converted into a byte stream23456. Serialization is the process of converting an object's state into a format that can be stored or transmitted and later deserialized back into an object23456.To make a class serializable, it needs to implement the Serializable interface2346. This interface acts as a flag to the Java runtime that the class can be serialized1. It is a marker interface because it does not contain any methods or fields to implement1236.When a class implements Serializable, all of its subtypes are also considered serializable15.However, if a class has a reference to another object, both the class and the referenced object must implement Serializable, or else a NotSerializableException will be thrown5.
Last updated