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 openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
Is hashset sorted in java?
Describe the various concepts related to object oriented programming (oop).
What is function and method in java?
What types of index data structures can you have in java?
What is not object oriented programming?
Is string passed by reference in java?
What are streams?
What is the largest number a double can hold?
What about instanceof operator in java?
How to stop a thread in java? Explain about sleep () method in a thread?
Why is java called java?
I want to persist data of objects for later use. What’s the best approach to do so?
What is the difference between an inner class and a sub-class?
What restrictions are placed on method overloading in java programming?