public class Employee { public int hashCode() { return name.hashCode() + new Double(salary).hashCode(); } ... }