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.

Answers were Sorted based on User's Feedback



Hi can u pls tell me what is the use of marker interface. Iknow what is marker interface but what a..

Answer / 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

Hi can u pls tell me what is the use of marker interface. Iknow what is marker interface but what a..

Answer / sudheer

The interfaces with no defined methods act like markers. They just tell the compiler that the objects of the classes
implementing the interfaces with no defined methods need to be treated differently.
Example Serializable, clonable etc.

Is This Answer Correct ?    1 Yes 0 No

Hi can u pls tell me what is the use of marker interface. Iknow what is marker interface but what a..

Answer / sowmya sreenivasan

Marker Interface is also called Tagging interface which are used as a boolean property of a class but actually doesnt require implementation of any methods.
eg:java.io.serializable interface.
The objects of the class implementing this interface are serializable objects.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the function of static in java?

0 Answers  


What is the static keyword?

0 Answers  


What Is Composition?

0 Answers   IBS,


What is static keyword in java?

0 Answers  


Which collection is best for sorting in java?

0 Answers  


what is meant by package in java?

5 Answers  


what is multitherading

3 Answers   Tech Mahindra,


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

0 Answers   HCL,


What is access modifiers?

1 Answers   Cap Gemini,


what is polymorhism what is inheritance? what is Abstract n Interface? what if two interfaces have same method and a concrete class is implementing both the interfaces. Will there be a compilation error? What are mutable and immutable classes? How can u make a class mutable? when will u use dem ...explain with example? what is overriding and overloading? what is garbage collection? what is Thread? how do dey communicate? what are the different ways of implementing ? have u used any messaging technologies? what is synchronization? what are some additions in java 1.5? what are generics? whst is advanced for loop? what is finally block? can u have a try in finally? yes!! can u have a finally in finally? how do you write junits? when is a object eligible for garbage collection?explain? a = null and b has ref to a will b be eligible to be garbage collected? sql questions like diff joins? how do dey work? exception handling? what is marker interface? what is the need??

0 Answers   JPMorgan Chase,


What are singleton services?

0 Answers  


who can i handle multiple client in RMI

0 Answers  


Categories