Marker Interface is an interface which have no
fields or methods within it.
An empty
interface is called a marker interface.
It is
used to convey to the JVM that the class implementing an interface of this
category will have some special behavior.
Examples of marker interface are Serializable, Clonnable and
Remote interface.
If JVM finds a Class is Serializable, Clonnable and Remote
interface then it will do some special operation on it .Marker interface
indicates command to JVM or compiler to do some special operation.So
that marker interface is required in java
Example:
Public interface Serializable
{
//
}
No comments:
Post a Comment