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 consumer in java?
What are the drawbacks of reflection?
What is integer valueof?
What is a values collection view ?
How to create an immutable class?
Does java return by reference?
How can you traverse a linked list in java?
Why java is called not pure object oriented language?
Why main() method is public, static and void in java ?
What is ‘is-a ‘ relationship in java?
Explain the difference between intermediate and terminal operations in java8?
What are the uses of java?
Enlist diffrent types of inheritance supported by java?
Difference between serialization and deserialization in java?
Explain the difference between transient and volatile in java?