What is Marker Interface?
Marker Interfaces are giving specification to the JVM about the implementing classes. One of the features of the Java programming language is that it mandates a separation between interfaces (pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes. Often you will come across interfaces in Java that have no behavior. In other words, they are just empty interface definitions. These are known as marker interfaces. Marker interfaces are also called “tag” interfaces since they tag all the derived classes into a category based on their purpose. Some examples of marker interfaces in the Java API include: – Java.lang.Cloneable A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class. java.io.Serializable Serialization is nothing but s saving the state of an object to persistent storage as byte stream. Serializabili