What is deserialization and how do we do deserialization?

Answer Posted / javamasque

Here is updated answer
Deserialization is a process of retrieving object from byte stream. We have to fallow below steps for de-serialization
1. The object to be serialized need to implement java.io.Serializable interface.
2. It will use Java’s default serialization mechanism.
3. Generate serial version id for that serializable object.
4. Generate serial version UID for all super classes in hierarchy (all super classes if any) otherwise the properties of all its super classes will be assigned to its default value during deserializtion.
5. ObjectInputStream is used to read [readObject()] object.
6. FileInputStream is used to read from flat file.
7. The flat file extension should be (<file-name>.ser)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If two threads have same priority which thread will be executed first ?

970


Java.util.regex consists of which classes?

630


Is it necessary for the port addresses to be unique? Explain with reason.

670


Can java list contain duplicates?

662


Explain about static nested classes in java?

696






What is not thread safe?

613


can rmi and corba based applications interact ?

754


What does  mean in regex?

657


What is the structure of java?

614


What is the difference between a constructor and a method?

698


What is the constructor?

686


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

684


What is meant by class loader? How many types are there? When will we use them?

603


What do you understand by the term polymorphism?

718


Explain the JDB in depth & command line.

677