Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
RE: to tejinder!!!!
Posted by udayk on May 28, 2001 at 4:32 AM
Hi senthil, Can I answer a bit. Serialization means storing the state of an object to a secondary storage. Yes, If you want to serialize an object means, your object should implement the serialize interface. Then by de-serialization you can restore the state of that object. Note that Primitive datatypes are not serializable, so you can not store them in the secondary storage. You are right that we can store the objects in the memory by serialization. Storing an object means, take shopping cart example of the online shopping site. You've selected certain items into your cart & suddenly power went/server crashed something happend.. So next time you want to retain your selected items means, you've to store the state of your cart in some format... That can be either in database or a secondary memory storage. So, if you choose to store it in secondary memory then you've to serialize the state of your cart so that next time you can retain it. Hope it helps -uday > hello tejinder, > u said the use of serialization lies in saving and restoring the state of an object,so do all objects use serialization, if we wanna save that object? > > What did u meant by saying storing objects? am not clear with that one? > Is it that we can store objects in the memory by using serialization? > can u kindly tell me this in detail.
Replies:
|