Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what exactly are stored while serializing a object ?  RSS feed

 
Ajit Amitav Das
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
Ranchers ,

While Serializing an object what actually is stored in persistent media , is it only instance variables which are nontransient or something along with those variables.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The doc on serializable is pretty good about what works and what doesn't. I wouldn't attempt to reproduce all the rules here. But you did hit one good point - transient variables are not serialized by default. You can override readObject and writeObject to override the default rules, making just about anything possible.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!