What is the use of Marker Interface ?

Explain the purpose of Marker Interface.
When there is no methods in marker interface then what is the use of implementing it?

Questions by ameesala   answers by ameesala

Editorial / Best Answer

jasmin sheeba rani  

  • Member Since Oct-2009 | Oct 6th, 2009


Marker interfaces are also called "tag" interfaces since they tag all the derived classes into a category based on their purpose. For example, all classes that implement the Cloneable interface can be cloned (i.e., the clone() method can be called on them). The Java compiler checks to make sure that if the clone() method is called on a class and the class implements the Cloneable interface.

Showing Answers 1 - 0 of 0 Answers

Marker Interface is a Java interface which doesnt have any methods in it. Marker Interfaces are Serializable, clonable, Singlethreaded model, Event listener. Marker interfaces are implemented by the class or its super class inorder to add some functionality.

  Was this answer useful?  Yes

Marker interfaces are also called "tag" interfaces since they tag all the derived classes into a category based on their purpose. For example, all classes that implement the Cloneable interface can be cloned (i.e., the clone() method can be called on them). The Java compiler checks to make sure that if the clone() method is called on a class and the class implements the Cloneable interface.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions