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
Where is singleton pattern used?
What is numeric function?
Is hashset ordered?
What is set in java?
What is variable and constant explain with example?
When is the finalize() called?
Is char a method in java?
What are 3 boolean operators?
What class of exceptions are generated by the java run-time system?
What are streams in java 8?
What is the function of compareto in java?
What do you know about the garbage collector?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is the difference between procedural and object-oriented programs?
What is java instanceof operator?