posted 20 years ago
Marker interfaces are like directives to the compiler. They do not have any methods. For example Serializable is a marker interface. If you wish to denote that your class is serializable then it should implement the Serializable interface. But there are no methods in this interface.
Similarly the interface Cloneable does not have any methods but if you want your class to be Cloneable it must declare so by implementing the Clonable interface.
Remeber the clone method is inherited from the Object class. So even though all classes have this method it can be used only if your class implements the Cloneable interface. Not doing so will result in CloneNotSupportedException being thrown.