Marker interface means , interface which has no methods.Then
what is the necessity of its usage.I read "it tells the
compiler that it should be treated differently ". "It is
used to store state of an object". But still am not
clear.Please explain clearly.
Answers were Sorted based on User's Feedback
Answer / pratap jadaun
Marker interface means, interface which has no methods. Then
what is the necessity of its usage. I read "it tells the
compiler that it should be treated differently ".
but the marker interface is not only
used to store state of an object
below given list of marker interfaces
- java,lang.Cloneable
- java,io.Serializable
-java.util.EventListener
....
these are marker interfaces in java and each interface is
used for different purpose
A class implements the Cloneable interface to indicate to
the Object.clone() method that it is legal for that method
to make a field-for-field copy of instances of that class.
"Serializable is used to store state of an object".
| Is This Answer Correct ? | 1 Yes | 1 No |
What is prime number in java?
What is a deadlock ?
what is inner class in java?
What is classpath?
What are the differences between this and super keyword?
How concurrent hashmap works?
How would overload a function based on return type?
What do you mean by Function Overloading in java?
Difference between Applet & Application?
Why does java have different data types for integers and floating-point values?
what is difference between servletconfig and servletcontext?
In how many ways we can create threads in java?