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
How do I get a substring?
What are annotations in java?
How do you sing an Applet ?
Why java is said to be pass-by-value ?
Write a code to create a trigger to call a stored procedure
What is final variable?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
Why strings in java are called as immutable?
What is mean by collections in java?
How do I find and replace in word?
Define the term string pool?
Which is bigger float or double java?
How do you override a variable in java?
What is meant by data hiding/encapsulation?
What is the default value of byte datatype in java?