Can any one tell the In which situation Marker Interface will usefull?
Asked
Active
Viewed 137 times
-4
-
I don't particularly agree with the accepted answer to those duplicates. – Peter Lawrey May 07 '14 at 12:36
-
1@PeterLawrey: feel free to post a better answer there :-) – Mat May 07 '14 at 12:46
1 Answers
0
1.Marker Interface does not have any methods inside interface.If our class implements any marker interface internally jvm will add some capabilites to our class.
2.Some of the marker interfaces are
Serializable,Cloneable,RandomAccess etc
3.Marker interfaces are introduced to reduce the burden on the developers.Internally jvm takes care of logic when we implement markerinterface to add the capability or functionalty to our class
4.We can write our own marker interface only possible with customization of jvm
Uses
1.Marker interfaces are useful to declare the metadata about the class
2.Marker interfaces are useful in the case other code takes decisions depending on whether an object implements some marker interface.

Naveen
- 535
- 3
- 14
-
A few duplicates of this question had been identified before you posted this. If you have something to add to the existing answers on those duplicates, you'd be better off posting an answer there than here. – Mat May 07 '14 at 13:02