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
What is the difference between hashmap and hashtable? What is an interface?
Difference between string, stringbuffer and stringbuilder?
What is an immutable class? How to create an immutable class?
How to solve the problem of generating the unique hash keys with hash function?
What are different exception types exceptions available in java ?
Give an example of call be reference significance.
What is flag in python?
What are the types of java?
What is an object's lock and which object's have locks in java programming?
What is a default constructor and also define copy contrucyor?
What is meant by 'Class access modifiers'?
What is a cup of java?
How do you write methodology?
How does list work in java?
When is the arraystoreexception thrown?