File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Serialization" Watch "Serialization" New topic


Ramesh Shanmugam
Ranch Hand

Joined: Sep 13, 2004
Posts: 132
What is serialization ? What is its need and how it can be implemented? give me an live example

Ramesh Shanmugam - SCJP 1.5
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
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
Bimal Patel
Ranch Hand

Joined: Aug 29, 2003
Posts: 130

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)
I agree. Here's the link:
subject: Serialization
jQuery in Action, 3rd edition