Home > DeveloperSection > Interviews > How do I serialize an object to a file?

Posted on    August-23-2014 6:10 AM

 Java Java 
 1 Answer(s)
  864  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Posted on    August-23-2014 12:00 AM

The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file.

Don't want to miss updates? Please click the below button!

Follow MindStick