Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

serialize object

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You got style baby! More than this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic