// Project: Serialization // Module: serialization2 // Source code file: Employee.java // Show how to serialize an ArrayList collection. public class Employee extends Person { private static final long serialVersionUID = 2L; private int id; protected double salary; public Employee(String name, char gender, int age, int id, double salary) { super(name, gender, age); this.id = id; this.salary = salary; } @Override public String toString() { return super.toString( ) + " " + id + " " + salary; } public double getCompensation( ) { return salary; } }