Java Serialization Example

This code illustrates marking a class as Serializable so it can be written to and read from a file easily. This is also useful if transmitting data via RMI. Build the solution by typing
        javac Phones.java
Run the solution by typing
        java Phones add zoe 555-9876
or the like.

For example (where % marks lines entered by the user):

        ls phone-book.dat
        /bin/ls: phone-book.dat: No such file or directory
        % java Phones add zoe 555-9876
        % java Phones get zoe
        Phone # for zoe: 555-9876
        % java Phones get rich
        No phone entry for rich
        % java Phones add zoe 555-6789
        % java Phones get zoe
        Phone # for zoe: 555-6789