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
Explain about transient variables in java?
What is the impact of declaring a method as final?
Can extern variables be initialized?
Can we assign null to double in java?
What is a dynamic array in java?
Why is java called java?
Can we use return in constructor?
What is a boolean in java?
What is difference between string and new string?
Why packages are used?
When is the garbage collection used in Java?
What is the purpose of using the java bean?
What is string [] args?
What is variable and constant explain with example?
Is integer passed by reference in java?