Actually what i am trying to know the term "serialize"..
"Objects are serialized with the ObjectOutputStream and they are deserialized with the ObjectInputStream."
And what the above says..
Thanks,
P.Jerald
"Serializable" means you can save and load the whole object, for example to a file on a disk, or to a database, with just a single command and without going into its internals.
"Stream" means, you save or load the data to a disk, to a database or to whatever external device you want. It depends on the type of stream.
For example you have an object that stands for a company. Inside you have a list of employees and a list of rooms. Each employee is an object that has a name, salary, etc.. Each room consists of a list of furnitures. So you see you have a rather complex object. Without serialization, you must loop through the data of your company object and save all the employees, rooms etc., one by one. And when saving an employee, you must write code to save its name, salary etc.. You would do that in some hundred lines of code. And whenever your structure changes, you have to rewrite your code. But with serialization (that means if all components implement the serialized interface), you can save the whole structure with a single command. You can also read an object with a single command.
No need anymore to write all these lines of code. If your structure changes, no need to change any single line regarding saving or loading. But there is one drawback: if your structure changes, you cannot read an old object into a new structure. Usually you read in an old object and copy the data over into a new object.