HOW SERIALIZATION HAPPEN IN MARKER INTERFACE
Hi
I have doubt about Serializable Interface, How it happen, Serializable Interface is marker interface, it doest have any method and variables. Then how it perform Serialization.
if any one know the answer please explain.
Thanks and Regards
babu Jayaraman
babuj@rsi.ramco.com
babuj03@rediffmail.com
# 1
> I have doubt about Serializable Interface,
> How it happen, Serializable Interface is marker
> interface, it doest have any method and variables.
> Then how it perform Serialization.
It (whatever that was supposed to mean - I guess you meant the interface) does not perform serialization. The serialization is implemented in ObjectInputStream and ObjectOutputStream and there is a check to see if the class being serialized is Serializable (implements Serializable interface).
http://java.sun.com/developer/technicalArticles/Programming/serialization/
# 2
think of the Serializable interface as a sticker you stick on envelopes saying "urgent documents enclosed": the sticker doesn't affect the envelope at all, or how it works, and the sticker doesn't do anything itself, but certain bodies that handle the envelope will treat it differently because of it. when the envelope arrives at it's destination, if there aren't any urgent documents inside you might be in trouble, but there's nothing to stop you putting it on anyway
that's what the Serializable interface is like