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
Explain about wait() method?
What is "this" keyword in java? Explain
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is meant by class loader? How many types are there? When will we use them?
How do you do exponents in java?
What is use of static method?
What is unicode used for?
How is hashset defined in java?
What is the purpose of static methods and variables?
What is externalizable?
What is meant by flickering?
What is java command?
'A class is a template for an object' explain this statement.
How do I type unicode?
Why java is secure? Explain.