Serializable is a 'tag' interface - it has no methods to implement. It is just used to indicate that a class can be serialized (in some cases you specifically DONT want them to be serializable, which is why classes are not serializable by default).
This short example writes out an instance of a Person object to a file on disk. It assumes you have a person class that implements Serializable:
And the code to read it back in again:
Both of these examples could throw an IOException so should be enclosed in try-catch statements.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop