An interface that does not declare or define a method is called a markup interface (Mark Interface). When a class implements this interface, it does not need to override the method to indicate the functionality that has interface tags. The 3 tag interfaces commonly used in Java are as follows:
1 Serializable
The Java.io.Serializable interface is used to mark whether a class supports serialization. Serialization refers to converting a Java object into a binary byte code. If a class does not implement the interface and the class instance performs a serialization operation, the JVM throws a Notserializableexception exception.
2 cloneable
The Cloneable interface is used to mark whether a class supports cloning. If a class does not implement the interface and the class instance performs a clone operation, the JVM throws a Clonenotsupportedexception exception.
3 randomaccess
The Randomaccess interface is used to mark whether a class supports random access.
Resources
Internal organs Heart--Java Tag interface
In-depth learning of Java serialization
"Java Programmer interview written book" P54-56
Java Markup Interface