Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Why serialization is required in java?

0 votes
1,576 views
Why serialization is required in java?
asked Nov 15, 2013 in Java by Saurabh Jain

1 Answer

0 votes

There are following reason for using serialization in java:

  1. Serialization is used when there is need to send your data over network or to store in files. By data I mean objects and not text.
  2. Serialization is the translation of your Java object's values/states to bytes to send it over network or save it.
  3. If you want to store an object (-structure) on disk you'll need serialization.
  4. A webservice requires serialization of objects to xml before they can be transmitted.
  5. Serialization is a binary format, it is much more compact than the textual format, and so you will probably use less space (This is good for conserving network bandwidth or for conserving storage space on disk).
  6. Serialization process saved the time in communicating mass amount of data.
  7. Serialization Examples when you need this:
    • Caching objects
    • Making remote method calls
    • Saving an object graph to disk
answered Nov 16, 2013 by Neha Katiyar
...