This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialization

 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is serialization ? What is its need and how it can be implemented? give me an live example
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic