Object serialization in Java Some times you need to store a small amount of data in between program runs, or you need to transmit objects from one process to another. You can do this via Serialization. Serialization is a very handy capability built into Java that allows you to transform an object into a compressed data stream that can be written out to a file, or an output stream, and then subsequently read in from that file, or read in from an input stream. This allows you to store persistant data without using a database or a text file, or to pass objects from one program to another. In order to serialize an object, you need to do two things; Declare that the object's class implements the java.io.Serializable interface, and ensure that any instance variables in the class also implement the java.io.Serializable interface. Check out SerializationTest.java in the Code Examples section for an illustration of serializing an object to a file.