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
Can we call a non-static method from inside a static method?
What are the application of stack?
Is it possible to write a regular expression to check if string is a number?
What is a map? What are the implementations of map?
What is object english?
What is treeset in java collection?
What is the use of arrays tostring () in java?
Is null or empty java?
What is the difference between compare and compareto in java?
What is static class
What is java instanceof operator?
Explain different types of thread priorities ?
Can extern variables be initialized?
Can a class with private constructor be extended?
Why doesn't the java library use a randomized version of quicksort?