This isn't too difficult. When writing the objects to a file you need to make sure that their integrity as java objects is retained. This is done through serialization. An object that is serializable can be successfully serialized (converted to a serial format) and unserialized. To write an object to a file, all you need to do is something like this:
To read the object from the file you just do the opposite:
That's all there is to it!
Originally posted by Anish Yadav: Can anyone tell me how to store a object into a file and later on restore it.
[This message has been edited by Matt Senecal (edited April 30, 2001).] [This message has been edited by Matt Senecal (edited April 30, 2001).]
There's nothing more dangerous than a resourceful idiot. ---Dilbert