What is deserialization and how do we do deserialization?

Answers were Sorted based on User's Feedback



What is deserialization and how do we do deserialization?..

Answer / javamasque

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. Only default constructor is applicable to all class hierarchy (from child to all super classes if any). It is necessary at deserialization otherwise throw InvalidClassException.
5. 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.
6. ObjectInputStream is used to read [readObject()] object.
7. FileInputStream is used to read from flat file.
8. The flat file extension should be (<file-name>.ser)

Is This Answer Correct ?    1 Yes 0 No

What is deserialization and how do we do deserialization?..

Answer / 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

What is deserialization and how do we do deserialization?..

Answer / javamasque

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 / java.io. Externalizable interface.
2. Generate serial version id for that serializable object.
3. ObjectInputStream is used to read [readObject() or readExternal()] object.
4. FileInputStream is used to read from flat file.
5. The flat file extension should be (<file-name>.ser)

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

what is singlton class?where it is use in real time senario.

1 Answers   Wipro,


List the features of java programming language.

0 Answers  


What is meant by event handling in SAX parser?

1 Answers   Ness Technologies,


Can we use string in switch case in java?

0 Answers  


What does n mean in java?

0 Answers  






What is java string pool?

0 Answers  


What is the char data type?

0 Answers  


How many types of JVM's (OR) Name of the JVM's which are used in Tomcat & Weblogic servers ?

1 Answers   TCS,


If I only change the return type, does the method become overloaded?

0 Answers  


Can one thread block the other thread?

0 Answers  


When do we use hashset over treeset?

0 Answers  


Tell some latest versions in JAVA related areas?

0 Answers  


Categories