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
Define how can we find the actual size of an object on the heap?
What is the difference between static (class) method and instance method?
What is classpath?
Explain about map interface in java?
What advantage do java's layout managers provide over traditional windowing systems?
Why is singleton instance static?
What is method overloading with type promotion?
Explain the difference between abstract class and interface in java?
What is argument in java?
What is comparator in java?
What is the size of integer?
What is null mean in java?
How to reverse string in java?
What is local variable and instance variable?
Is arraylist an object in java?