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
Can a top level class be private or protected?
What is a constructor, constructor overloading in java?
What is stringjoiner ?
What is method in java ?
What is this keyword used for?
Is double bigger than float?
What are some examples of variable costs?
Explain about doubly linked list
How do you check if two strings are equal in java?
What exactly is a .class file?
Why declare Main() method as a static in java ?
In which language java is written?
What is constructor and virtual function? Can we call a virtual function in a constructor?
What does string [] args mean?
What is the buffer limit?