What is serialization ? What is its need and how it can be implemented? give me an live example
Ramesh Shanmugam - SCJP 1.5
Joined: Aug 04, 2004
Serialization means that you save the object to the hard disk or something like this. Only thing you need is that your class need to implement the Serialization interface. Transient fields are not serialized. Look at Sun tutorial, you will found there an example.
SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Joined: Aug 29, 2003
Serialization means writing a state of an object to a stream i.e. either to a file or to any other stream. Serialization is used in some advanced topics like RMI and EJB. To serialize an object, one has to implement Serializable or Externalizable. Serializable is a marker interface. While writing an object state, the compiler will check whether the object's class is of type serializable or not. If not, it'll throw an exception.
Thanks & Regards,
Work Hard, Expect The Worst...<br /> <br />Bimal R. Patel<br />(SCJP 1.2, SCWCD 1.4)