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

Can a class be defined inside an interface?

565


What is blank final variable?

567


What is difference between throw and throws ?

602


Can we create an object of static class in java?

597


For class CFoo { }; what default methods will the compiler generate for you>?

620






Write a program to print count of empty strings in java 8?

538


What are triggers in DB? Explain their types. How do they work?

628


How to avoid memory leak in java?

600


Explain wrapper classes in java?

534


Is void a data type?

540


What is the maximum size of array in java?

518


Does .length start 0 java?

569


What are the main uses of the super keyword?

558


What is printwriter in java?

520


What is the difference between Error, defect,fault, failure and mistake?

660