Hi can u pls tell me what is the use of marker interface.
Iknow what is marker interface but what ability will the
object get by implementing this.

Answer Posted / guest

Marker interface plays vital role even though it doesn't
contain any methods.The main purpose is to identify the
special objects from normal objects for example if you want
to serialize an object then how you will inform to the JVM
to serialize the particular object because there may be so
many objects available in JVM. In order to know which object
is to be serialized marker interfaces are used. When you
implement a marker interface the object will be tagged with
boolean property with that property JVM knows which object
should be serialized and which object should not be serialized.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is garbage collection? Can it be forced to run?

539


What is default locale java?

534


Write a method that will remove given character from the string?

570


Is it possible to override the main method?

530


What is an immutable class?

614






What is meant by bytecode?

572


Does google use java?

534


Explain about exception propagation?

583


What classes of exceptions may be caught by a catch clause in java programming?

699


How can you make a class serializable in java?

566


How do you join strings in java?

522


What is a local class in java?

583


How many bytes are there?

537


What are the differences between heap and stack memory in java?

535


What is the method to declare member of a class static?

534