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

what is the use of bean managed and container managed with example?

1593


Why do we need hashset in java?

608


What access modifiers can be used for variables?

698


Lowest Common ancestor in a Binary Search Tree and Binary Tree.

647


Is break statement can be used as labels in java?

587






What is polymorphism and what are the types of it?

593


How can you read an integer value from the keyword when the application is runtime in java? example?

711


Do we need to manually write Copy Constructor?

685


What is difference between path and classpath in java?

574


What package is math in java?

631


Is there any case when finally will not be executed?

612


Explain about arraylist?

664


Why hashmap is used in java?

639


What is meant by class loader? How many types are there?

780


Is it safe to install java on my computer?

642