Hey buddy.. can you please tell me about the use of marker
interface? And is there any link between marker interface
and factory methods?
Thanks in advance.

Answers were Sorted based on User's Feedback



Hey buddy.. can you please tell me about the use of marker interface? And is there any link between..

Answer / namita

Marker Interface or sometimes called as Tagging interface
are empty interface which means it does not have any
methods. The use of the these interface is below

Like clonneable interface which is also a marker interface
when ur code implements clonneable interface the JVM will
come to know that you want to clone the object by calling
clone method(). Similalry serializable interface needs to
be implemented when you want to serialize the objects.

Their implementation is just to make aware the JVM.

Is This Answer Correct ?    2 Yes 0 No

Hey buddy.. can you please tell me about the use of marker interface? And is there any link between..

Answer / venkat

Marker Inferface doesnt consists any methods
it gives prior intemation to JVM to treat specially

Ex:Serialiazable
singleThread

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is a vararg?

0 Answers  


How static variable work in java?

0 Answers  


Distinguish method overloading and method overriding

4 Answers   Tech Mahindra,


Does any tag exists in HTML to upload and download files ?

3 Answers  


How do u provide security in java

3 Answers  






Can set contain duplicates?

0 Answers  


What defines function?

0 Answers  


What is a java string?

0 Answers  


What is a short in java?

0 Answers  


What is I/O Filter?

2 Answers   TCS, WAX,


What is parseint?

0 Answers  


What is string buffer?

0 Answers  


Categories