Answer Posted / javamasque
Here is the updated answer
We have to fallow below steps to serialize an object
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. ObjectOutputStream is used to write [writeObject] object.
6. FileOutputStream is used to persist in flat file.
7. The flat file extension should be (<file-name>.ser)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain about field hiding in java?
How many arguments can be passed to main ()?
What is a native method in java programming?
How is hashset defined in java?
What is the difference between assignment and initialization?
Explain java coding standards for classes or java coding conventions for classes?
Can a class have a static inner class?
What is the purpose of the system class in java?
What are the core java topics?
Is a method a function?
What are the different data types in java?
Is java written in c?
What is the difference between the paint() and repaint() methods in java programming?
What is a war file?
What is a protected void?