what is use of marker interface? give me good example?
Answer Posted / aravind
In java language programming, interfaces with no methods are
known as marker interfaces. Marker interfaces are
Serializable, Clonable, SingleThreadModel, Event listener.
Marker Interfaces are implemented by the classes or their
super classes in order to add some functionality.
Suppose the interface Clonable is neither implemented by a
class named Myclass nor it's any super class, then a call to
the method clone() on Myclass's object will give an error.
This means, to add this functionality one should implement
the Clonable interface. While the Clonable is an empty
interface but it provides an important functionality.
| Is This Answer Correct ? | 10 Yes | 6 No |
Post New Answer View All Answers
What is difference between static and abstract class?
What comes to mind when someone mentions a shallow copy in java?
What is difference between add() and addelement() in vector?
What is the longest unicode character?
What is the use of a copy constructor?
Are functions objects in java?
What is a final class in java?
What is a vararg?
What is difference between == and === in js?
What are the ways in which a thread can enter the waiting state?
What is string manipulation?
Explain about main() method in java ?
Why vector is used in java?
Can list contain null in java?
Is age a discrete variable?