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.
Answer Posted / 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 |
Post New Answer View All Answers
Can we call thread start () twice?
What is the char data type?
Explain working of call by reference function invoking.
What does string [] args mean?
What are the supported platforms by java programming language?
How to make a write-only class in java?
Which collection does not allow duplicates in java?
How to convert string to char and vice versa?
What is the difference between @before and @beforeclass annotation?
How can we make a class singleton?
Where is const variable stored?
How does arraylist size increase in java?
Can a static method be overridden in java?
Does hashset allow duplicates in java?
Explain throw keyword in java?