nirjari patel wrote:Still I am confused as before.
This is what I read from a book.
"Serializing the object is the process of writing its data members to disk. Deserializing an object is the process of reconstructing the object instance from the data members written to disk."
I guess this is where I am confused.
I dont understand when serialization takes place
1) Is serialization something that takes place after code is executed ?
while downloading or uploading songs, where does java code come in picture ? If songs or videos are on the server, then are they there in the form of java objects ? where is java used in keeping songs on server ? When we send a request to download a particular video , does it go the java program (If java is used) and then that program retrieves that video from database and these videos are in serialized form ?
2) when a java byte code "serializationTest" is executed, whatever code is there inside this class gets executed and output is displayed on the screen.
Once the output is displayed we can save this output in any file by taking screen shot or downloading it
3) Once the bytecode is executed, all the objects have been executed
and everything we can save is output. What is the state of objects after a code is executed ?
where does the question of preserving objects arise once code is executed ?
Do we preserve the state of objects while code is being executed ?
5) As Vivek Singh explained, downloaded songs , videos etc are the serialized, so we wont loose them. What does that mean ? Are the songs and videos in the serialized form ? If they are not serialized, why and how would we loose them while downliading ? When I am downloading a video, I am not using any javaclass or anything like that to deserialize them, so how does serialized objects become deserialized ? When I am uploading a video , I dont do any serialization. Then how do these videos become serialized ?
6) Does serialization save space ? Many times Songs and videos are zip files, so is serialization and file compression same thing ?