java - How marker interface are identified by JVM? -
this question has answer here:
- how marker interface handled jvm 6 answers
i have gone through few question in stack overflow not find suitable answer. raising more clarity.
i know marker interface interface no methods. when implement marker interface example serializable declares class implementing becomes eligible serialization.
my question how jvm understands objects of class implementing serializable interface should serialized. if write interface no methods , hope objects of class implements serialized i'll not work way.
is possible create custom marker class.?
they aren't 'identified jvm' @ all. they're identified java code interested in them, example objectoutputstream
, via instanceof
operator.
Comments
Post a Comment