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 best practices should you follow while writing multithreaded code in java?
How do you convert string to int in java?
What are JVM.JRE, J2EE, JNI?
What is the difference between final, finally and finalize() in java?
How are multiple inheritances done in Java?
How do I compare two strings in word in java?
what is the difference between future and callable interface in java?
what is object slice?
What do you mean by garbage collection used in java?
Why are functions called methods in java?
Define immutable object?
What do you mean by exception handling in Java?
How many decimal digits is 64 bit?
What is integer size in java?
Define class?