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 does percent mean in java?

590


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

571


Define reflection.

575


What is difference between calling start() and run() method of thread?

555


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

582






How do I compare two strings in word in java?

541


What is purpose of keyword void?

565


What will happen if static modifier is removed from the signature of the main method?

526


Explain static nested classes ?

594


What is immutable in java?

544


Is java written in c?

542


How do you check if a string contains only numeric digits?

617


What is difference between iterator access and index access?

648


What does void * mean?

533


Is hashset ordered?

551