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
How to sort array in descending order in java?
What is a literal coding?
What is java lang object?
What does indexof return in java?
What does it mean that strings are immutable?
Can constructor be synchronized?
Describe the Big-O Notation.
How arrays are stored in memory in java?
What is the purpose of void?
Explain the difference between transient and volatile in java?
Is java platform independent?
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
What are streams in java 8?
What is a percentage sign called?
How do you define a set in java?