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
Difference between Preemptive scheduling vs. Time slicing?
what do you understand by synchronization? : Java thread
Can we make constructors static?
What is the concatenation operator in java?
what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread
Can we override the private methods?
If an object is garbage collected, can it become reachable again?
What is method in java ?
What is private protected in java?
What is void class in java?
What do you understand by copy constructor in java?
What is the null?
What is variable declaration and definition?
How do you calculate square roots?
Explain about sets?