Why we need to serialize the object

Answer Posted / sandeep jaisawal

For an example,if you are suppose to send some data from
obe JVM to other JVM, in that case state of ojects are not
known and will not persist if you dont serialize the object
and sent over a network.

because you allocate seperate heap for seperate JVM.

So you have to tell JAVA that please treat my object, in a
different way because i have make them serialised...

Once the data(object) is serialised, you cant send it any
wr like, write in to DB,othere JVM,files etc. and later
point of time you can deserialise them and you can the same
state of the object.

Hope this help.


Sandeep j

Is This Answer Correct ?    39 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a switch statement and an if statement?

788


What is indexof?

741


What is a variable analysis?

856


What is gui programming?

740


Is linked list a linear or non-linear data structure?

754


What a static class can contains?

937


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

801


What an i/o filter?

748


What access modifiers can be used for variables?

837


What is an infinite loop in java? Explain with an example.

808


What is outofmemoryerror in java?

781


What is a pointer and does java support pointers?

802


Is there a case when finally will not execute?

783


What is the difference between superclass and subclass?

805


When is the finally clause of a try-catch-finally statement executed?

747