Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is called marker interface? list out any three marker interfaces?

user-image
Question ajoutée par subramanyam guntakal
Date de publication: 2013/07/23

marker interface is a interface in java which has no fields or methods.in other words empty interface in java is known as marker interface.

there are some examples of marker interfaces are 

1 serializable 2. clonable 3. remote interface

1. java.io.Serializable (the object is serializable)

2.java.lang.Clonable (the object is cloned)

3.javax.servlet.singleThreadModel

Marker interface in java  is a kind of interface which has no method is known as marker interface. Serializable, Clonnable is the example of marker interface.

The three marker interface are,

1. MyMarkerInterface.java                (which is own created marker interface)2. ImplMarkerInterface.java              (A java class which implments my marker interface)3. FunctionalityMarkerInterface.java  (which help you to understand how the JVM do                                                                special operation for marker interface)

For coding part refer belo URL,

http://beyondcorner.com/create-own-marker-interface-in-java/

Zaheer Basha Gheewale
par Zaheer Basha Gheewale , Electrical / ELV Engineer , Construction and Reconstruction Engineering Company

An interface without any body (empty body) is called a Marker Interface

Abhijeet Thool
par Abhijeet Thool , IT Project Manager , US Confidentail Company

An interface is called a marker interface when it is provided as a handle by java interpreter to mark a class so that it can provide special behaviour to it at runtime and they do not have any method declarations.
Example: java.lang.Cloneable java.io.Serializable java.util.EventListener

Advaitha Chidurala
par Advaitha Chidurala , Teacher , Little Masters Abacus

An interface which does not contain any methods is called a marker interface.

e.g:java.io.Cloneable

      java.io.Serializable

      java.io.EventListener

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?