This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can we override writeobject method to acheive serializable concept?

 
arulraj michaelraj
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I know serialization concept. Generally if you want to make a class as serializable,you can implement serializable interface..

once we implement it, jvm take care of the object to be serialied by using writeObject and readobject method().
But my doubt is that can we override these methods directly in our own class,so that we can achieve that serialiable concept?
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the documentation.

It is possible to override the default serialisation behaviour. How that is done is slightly arcane, but well-documented.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic