How does marker interface provides functionality to the
implemented class ?
or How dose maker interface gets the functionalities as
serialization or cloning.
Answer Posted / somasundar m
Marker interface is a an interface which doesnot have any
variables and methods. Since it is following the design
pattern called Marker Design Pattern its is called as
Marker interface. This marker interface just tells the
compiler that all the marked classes with certain interface
names should be treated differently. It is used just to
mark the selected classes to do a certain functionality.
Example Serializable, Clonnable, etc. Here Serializable is
a marker interface just compiler to indentify which are the
classes should be marked for serialization. Now it can be
replace with annotations.
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What are different types of inner classes ?
What is the purpose of the main method?
Are there structures in java?
Explain the difference between serializable and externalizable in java?
Why is a string immutable?
How can you add and remove nodes in jtree?
What is the use of string and stringbuffer?
What is the purpose of file class?
Does a function need a return?
Does constructor creates the object ?
What do you mean by static variable?
What methodology can be utilized to link to a database?
Is final static java?
What is jpa specification?
What is difference between c++ and java ?