Marker Interfaces

An interface without fields or methods is called a marker interface. They are used to hint the compiler or the JVM.

public class Message implements Serializable {}

The Serializable is a marker interface. The above will allow the Message class to be serialized.

Serialization is the process of converting an object into a stream of bytes or store the object or to transmit it to memory, database, or a file.

Its main purpose is to save the state of an object in order or be able to recreate it when needed. The reverse process is called deserialization.

results matching ""

    No results matching ""