how a marker interface gets its functionality and when we
implements a marker interface how it got invoked
Answer Posted / somasundar m
Marker interface are a design pattern which is used to mark
the classes for doing some specific actions. Marker
interface are just to mark the classes. For example
Serializable is a marker interface. So jvm looks for the
classes which are marked as serializable to serialize the
objects. It tells the compiler that the marked items
should be treated differently. Since it is a older design
pattern. Now a days Annotations has been introduced, so we
can replace the usage of marker interface with annotations.
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Why does java not allow multiple public classes in a java file ?
Define canvas?
What is broken and continue statement?
Define class?
Difference between java and javascript
Why is java so popular?
Can we execute a program without main?
What package is math in java?
Why is java called java?
What does the “static” keyword mean? Can you override private or static method in java?
What is the generic function?
Can vector have duplicates in java?
How large is a boolean?
What is memory leak and how does java handle it?
What type of variable is gender?