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


Please Help Members By Posting Answers For Below Questions

What are recursive functions? Give some examples?

612


Justify your answer that you can't define a method inside another method in java, if you can then how?

600


What are accessor methods in java?

547


Why you should not use singleton?

536


Explain about core java?

618






What are the principle concepts of oops?

534


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

504


What happens to the Exception object after handling an exception?

1807


Can vector have duplicates in java?

505


What is data type modifier?

527


What is quick sort in java?

551


What are the differences between string and stringbuffer?

584


What is synchronization and why is it important in java programming?

469


Discuss 2D arrays.

605


do I need to use synchronized on setvalue(int)? : Java thread

549