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
Give an example of use of pointers in java class.
What is incompatible types in java?
What is the benefit of using enum to declare a constant?
Can we have 2 main methods in java class?
When do you call copy constructor?
What are wrapped classes in java programming?
What do you mean by garbage collection used in java?
Which is bigger float or double java?
What is the use of http-tunneling in rmi?
What does I ++ mean?
What is the use of generics? When was it added to the Java development Kit?
What is difference between this and super keyword?
Is a char always 1 byte?
What is an empty class? What functionality does it offer in Java?
What is primitive data type in java?