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
What is static import?
What do you mean by an interface in java?
Explain java coding standards for interfaces?
What are the library functions in java?
What is nullpointerexception in java?
How does split work in java?
What is jvm? Why is java called the platform independent programming language?
How can we make string upper case or lower case?
What is the difference between @before and @beforeclass annotation?
If a class is declared without any access modifiers, where may the class be accessed in java programming?
What is final keyword in java? Give an example.
When does an object becomes eligible for garbage collection in java?
What is Major and importance difference between for and foreach loop ?
How do you use compareto method?
What does nextint () do in java?