why marker interfaces are there in java
Answer Posted / maurya
an interface without any method is known as marker
interface. we use marker interface to actually mark for JVM
to distinguish that the class is belongs or subclass of ant
particular super class.
EX-->
we have an interface named serializable. there is a
condition that if you want to serialize your object u must
have to implements marker interface.
by doing this we just only inform JVM that my class is able
to be serialized. JVM detact it at run time by using Class
class methods.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is array serializable java?
What is an class?
Is there any limitation of using inheritance?
Can a class be defined inside an interface?
What are the difference between string, string builder, and string buffer in java?
What is qms certification?
What are java packages? What's the significance of packages?
how does multithreading take place on a computer with a single cpu? : Java thread
State some situations where exceptions may arise in java?
Explain scope or life time of local variables in java?
Tell us something about an iterator.
Explain the public class modifier?
What is string substring?
What are exceptions
When object is created and destroyed?