Answer Posted / javamasque
We have to fallow below steps to serialize an object
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. ObjectOutputStream is used to write [writeObject(..) or wirteExternal()] object.
4. FileOutputStream is used to persist in flat file.
5. The flat file extension should be (<file-name>.ser)
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can we have static methods in an interface?
What is run time allocation?
Which is dependent variable?
Can we sort set in java?
How is Object Oriented Programming different from Procedure Oriented Programming?
What exactly is java?
Is java 11 paid version?
What are variable names?
What are the characteristics of java?
What is a linkedhashmap java?
What is a protected class in java?
Explain the difference between collection api and stream api in java8?
Why is singleton class used?
What are loops in java?
Is string serializable in java?