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 |
Is sizeof a keyword in java programming?
What is the return type of the main method?
What is the size of int in 64-bit jvm?
What is a J2EE component? List out all the component?
What is aggregation?
What is an object-oriented paradigm?
Which data type is a class in java?
What are features of java?
What is tree node in java?
What is abstraction in java?
0 Answers Akamai Technologies,
Is there any difference between nested classes and inner classes?
What is the benefit of lambda expressions?