In Java a tag interface (also called a marker interface) is one that has no methods. Thus a tag interface cannot be used to define behavior (in the usual sense) but it can nevertheless contain information about the given type. For example, it can
java.io.Serializable
Allows the state of an object to be converted to a byte stream in such
a way that the byte stream can be reverted back into a copy of the
object. A Java object is serializable if its class or any of its
superclasses implements the java.io.Serializable interface.
java.lang.Cloneable [Note: Does not contain
the clone()
method!]
Indicates to Object.clone()
that it is legal for that method
to make a field-for-field copy of instances of that class. By convention,
classes that implement this interface should override the protected method
Object.clone()
with a public method.