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
Can constructor be static or final?
Can you make a constructor final in Java?
What is static method with example?
Can a method inside a interface be declared as final?
Is binary a low level language?
What is file in java?
What is public/private protected in java?
Why do we override tostring method in java?
What happens if we don’t override run method ?
What is comparator in java?
Can we increase array size dynamically in java?
What are the advantages of assembly language?
How to display names of all components in a Container?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
Difference between a process and a program?