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 |
Why inputstreamreader is used in java?
What is difference between Eclips and MyEclips?
Differentiate jar and war files?
What is a map? What are the implementations of map?
Can we have multiple classes in a single file?
What is the main purpose of serialization in java?
Does A Class Inherit The Constructors Of Its Superclass?
What is a map in java?
Are arrays immutable in java?
Explain restrictions on using enum?
Can we override static methods?
18 Answers Bally Technologies,
why ,we are using jsp and html.which one is better?