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 thread? : Java thread

547


What is use of map in java?

507


What is a classloader in java?

534


Can we write multiple catch blocks under single try block?

566


extending thread class or implementing runnable interface. Which is better? : Java thread

561






Explain the Propertie sof class?

583


What is the syntax and characteristics of a lambda expression? Explain

537


What is the concept of multithreading?

516


What is meant by javabeans?

609


What is the base class of all exception classes?

577


what do you mean by marker interface in java?

541


Compare overloading and overriding?

557


How do you create immutable object in java?

535


is there a separate stack for each thread in java? : Java thread

533


What are the three parts of a lambda expression? What is the type of lambda expression?

563