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 |
When should you make a function static?
How big is a gigabyte?
What is bifunction in java?
What is heterogeneous in java?
Difference String and String Buffer
difference between jsp and java script?
What is the difference between an object-oriented programming language and object-based programming language?
How to invoke external process in java.
how to print the below in java? * * * * * * * * *
do I need to use synchronized on setvalue(int)? : Java thread
Is string a class in java?
How java uses the string and stringbuffer classes?