Created
April 24, 2024 16:41
-
-
Save pedroveras/47c7808abd556ed5d66677dc65a53bb8 to your computer and use it in GitHub Desktop.
Employee class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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