Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serializable interface

 
Vallabhaneni Suresh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The objects can be serialized if we extends Serializable interface. Then what are the purpose of writeObect() and readObject() methods? If we want to handle the serialization ourselves, we need to implement these methods or what?

Thank you
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, yes. But if you want to handle serialization yourself, you should implement Externalizable instead of Serializable (and use readExternal/writeExternal, not readObject/writeObject).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic