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.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of user defined functions?

643


What are different data structures in java?

612


What is the use of a conditional inclusion statement in Java ?

681


What is final keyword?

741


Can a method inside a interface be declared as final?

602






How does list work in java?

596


How thread scheduler schedule the task?

683


What is diamond operator in java?

587


How many types of gc are there in java?

655


Can we initialize the final blank variable?

693


Explain the init method?

621


Can we sort hashmap in java?

620


Why is it called a string?

650


How do you compare characters in java?

614


Does string isempty check for null?

673