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
What is difference between class and object in java?
How to perform linear search in java?
What is methods and methodology?
Which methods cannot be overridden in java?
What are the advantages of arraylist over arrays?
How do you do absolute value in java?
Why we go for collections in java?
Why is flag used in java?
Explain the features of java?
What is ctrl m character?
What is the difference between class forname and new?
Can we access the non-final local variable, inside the local inner class?
Why string is immutable with example?
What are thread local variables?
Is intellij better than eclipse?