What is Marker interface in java? and what is clone?

Answer Posted / kavya

It’s a kind of interface which has no method is known as marker interface. Serializable, Clonnable is the example of marker interface to create <a href="http://beyondcorner.com/create-own-marker-interface-in-java">Marker Interface in Java </a>
Use of Marker Interface:
Marker Interfaces are used to indicate something to compiler/JVM. If JVM see that a class is a object of Marker Interface then it will perform some special operation. Take an example with Serializable, Clonnable marker interface, if JVM see a Class is Serialized/Clonnable then It will do some special operation on it, similar way if JVM sees one Class is implemented custom marker interface which is created by ourself then the JVM do some special operation.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you handle java exceptions?

769


What is a final class in java?

811


What is the difference in between cpp and java? Can u explain in detail?

876


What do you mean by an interface in java?

799


What is null statement?

800


What is a modifier?

1201


Can we synchronize static methods in java?

837


What does indexof return in java?

781


How do you sort in descending order in java using collections sort?

728


What are actual parameters?

781


What are the advantages of java inner classes?

803


What is the difference between yielding and sleeping in java programming?

836


What do you understand by private, protected and public?

781


Is 64bit faster than 32 bit?

841


What is data object example?

750