Object Serialization (cont’d)
writeObject() will throw an Error if the
object passed to it is not Serializable.
You can control serialization by
implementing the Externalizable
interface.
readObject() returns something of type
Object, so it needs to be cast.