• Post Reply Bookmark Topic Watch Topic
  • New Topic

serialize object  RSS feed

 
Sebastian Green
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im very new to this, so Im having a hard time trying to serialize an Object containing a hashtable. CAn anyone point me in the right direction. I tried to get going with suns serialize tutorial buts its only confusing me.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sebastian,
Since this is apparently not an XML question, I'll move it to I/O
[ February 24, 2004: Message edited by: Lasse Koskela ]
 
Vrabie Cristian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im very new to this, so Im having a hard time trying to serialize an Object containing a hashtable. CAn anyone point me in the right direction. I tried to get going with suns serialize tutorial buts its only confusing me.
It's easy to serialize any object, no matter what it contains. You just have to implement the Serializable interface to the class (in this case containing the hashtable.). You will also need to implement Serializable interface to any class used inside. In your case the hashtable already implements it, so you don't need to worry about it. The you can use an object output stream. The writeObject method should do the rest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!