package person;


import java.util.*;
import java.io.*;

public class MainDriver {
	
	public static void main(String[] args) {
		
		Vector<Person> database = new Vector<Person>();
		database.add(new Person("John", "Doe", 29));
		database.add(new Person("Jane", "Doe", 30));
		Person person3 = new Person("A", "B", 43);
		
		try {
			FileOutputStream fos = new FileOutputStream("db.dat");
			ObjectOutputStream oos = new ObjectOutputStream(fos);
			oos.writeObject(person3);
			oos.close();
			
			FileInputStream fis = new FileInputStream("db.dat");
			ObjectInputStream ois = new ObjectInputStream(fis);
			person3 = (Person)ois.readObject();
			System.out.println("person3: " + person3);
			ois.close();
			
			
		} catch (Exception exc) {
			System.out.println("Exception: " + exc);
		}
	}	
		
}
