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
Why pointers are not used in java?
What are some examples of variable costs?
Is arraylist an object in java?
What is import java util arraylist?
Is .net better than java?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What is get () in java?
List some oops concepts in java?
What is mysql driver class name?
Can interface be private in java?
How to avoid memory leak in java?
How many arguments can be passed to main ()?
What is the difference between method overriding and overloading?
Why arraylist is not synchronized in java example?
What is a java string?