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

how is final different from finally and finalize in java?

816


What is the difference between preparedstatement and statement in java?

819


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

813


Difference between Preemptive scheduling vs. Time slicing?

796


How to create an interface?

829


What is the exact difference in between Unicast and Multicast object?

1768


what is thread in Java ?

896


What is immutable state?

733


Can we use different return types for methods when overridden?

770


What are the advantages of unicode?

788


What are the access modifiers available in java?

813


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

743


when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???

1910


Does sprintf allocate memory?

823


What are loops in java?

790