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
java program with complete 4 oops concepts implemented example
Why vector class is used?
What is null mean in java?
Explain different ways of creating a thread?
What are the five major types of reference sources?
What is the difference between JDK and JVM?
Why we cannot override static method?
What is keyset in java?
What is exception handling in java?
What is the reflection?
Explain inner classes ?
Can a class declared as private be accessed outside it’s package?
What is the difference between length and size in java?
How do you declare a string variable?
What is a parent class in java?