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
Differentiate between nested and inner class in java.
What is arraylist class in java?
What is the use of coding?
What is charat ()?
what is heap memory?
If two threads have same priority which thread will be executed first ?
What are predefined functions?
What is communist flag?
What are the differences between stringbuffer and stringbuilder?
What is lambda programming?
Differentiate jar and war files?
Can abstract class have private constructor?
Define interface in java?
whatis Home interface and Remoteinterface? with example?
What is difference between checked and unchecked exception in java?