Skip to content

Instantly share code, notes, and snippets.

@pedroveras
Created April 24, 2024 16:41
Show Gist options
  • Save pedroveras/47c7808abd556ed5d66677dc65a53bb8 to your computer and use it in GitHub Desktop.
Save pedroveras/47c7808abd556ed5d66677dc65a53bb8 to your computer and use it in GitHub Desktop.
Employee class
public class Employee {
private String name;
private String email;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Employee employee = (Employee) o;
return Objects.equals(name, employee.name) && Objects.equals(email, employee.email);
}
@Override
public int hashCode() {
return Objects.hash(name, email);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment