Java provides a feature called object serialization that allows you take any object that implements the Serializable interface and turns it into a sequence of bytes that can later be fully restored into the original object.
To get an idea of what serialization is doing, consider the nature of objects.
From Developing Java Beans by Robert Englander, O'Reilly, 1997.
"Most components maintain information that defines their appearance and behavior. This information is known as the
state of the object. Some of this information is represented by the object's properties. For instance, the font or color
properties of a visual component are usually considered to be part of that object's state. There may also be internal data
used by an object that is not exposed as properties, but plays a part in defining the behavior of the object nevertheless.
...The state information of all the components, as well as the application or applet itself, must be saved on a persistent
storage medium so that it can be used to recreate the overall application state at run-time. An important aspect of the
application state is the definition of the components themselves: the persistent state of an application includes a description
of the components being used, as well their collective state."