Serializable is used to read or write the object and find the state of an object. What is the use of finding the state of an object, Explain with an example?

Questions by gobinath.l

Showing Answers 1 - 15 of 15 Answers

pavan

  • Sep 24th, 2007
 

Serializable is the concept of saving the state of an object.

  Was this answer useful?  Yes

sampra

  • Feb 13th, 2008
 

If we have to use an object on remote mechine then we ned that data for this we neede serilizaion technique

  Was this answer useful?  Yes

ravi_1229

  • Apr 17th, 2009
 

Serializable is the concept of Storing the state of an Object. Consider a
scenario, you want to send an object via network. In the middle if the network fails or some error happens, your object state will be lost.
for ex: String is an serializable object. if you want to send a data via network, we usually send in String because the object state may not be lost as String is serializable object.

  Was this answer useful?  Yes

richakharya

  • Apr 19th, 2009
 

When the object supposed to be sent across the network serializing technique makes sure the data is not lost in case of network failure. Seralizaing  is converting the object to its byte code form and then sending it accross the network.

  Was this answer useful?  Yes


The concept of Serializable is that we can recreate the state of an object from a permanent source like a file, xml etc.

Example: I had personally implemented used in scenario where i had an organization which had their main offices in California, with branch offices in various other states. The branch offices used to have a front end, where the orders received were saved for their details like Order Id, Party Name, Order Amount etc. Then at the end of the day, all these files were ftp'ed to the Head Office and it was read back from the file.

The state of the order was serialized or persisted and then recreated and used again in the head office. We could ofcourse have used the normal File Streams for that, but then we could not consider it as an object and move on with it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions