Created
January 24, 2018 05:36
-
-
Save cleishm/8fad434a0b7fd6b01c14065eb32f224f to your computer and use it in GitHub Desktop.
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 Person { | |
String firstName; | |
String lastName; | |
public final boolean equals(Object other) { | |
if (this == other) { | |
return true; | |
} | |
if (other == null) { | |
return false; | |
} | |
if (!(other instanceof Person)) { | |
return false; | |
} | |
Person person = (Person) other; | |
return Objects.equals(firstName, person.firstName) | |
&& Objects.equals(lastName, person.lastName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment