• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization  RSS feed

 
vara prasad
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For storing the state of an object into a stream we use serializable interface. It is marked interface i.e it is not having any methods. I am having a doubt, how java virtual machine deals the serialization technique ( as serializable interface is not having any methods and we are not implementing any methods).
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That the Serialzable interface has no methods has got nothing to do with the actual Serialization process.
By implementing the Serializable interface, your class conveys to the jvm that its instances should allowed to be serialized (ie written to a persistent storage such as a file or transmitted over a network).
The actual Serilzation occurs when the object is written out using the writeObject() method of ObjectOutputStream.

ram.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!