Whenever you write a vector of instances using writeObject, each element must belong to a class that implements the Serializable interface.
writeObject