Skip to content

Instantly share code, notes, and snippets.

@cleishm
Created January 24, 2018 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleishm/8fad434a0b7fd6b01c14065eb32f224f to your computer and use it in GitHub Desktop.
Save cleishm/8fad434a0b7fd6b01c14065eb32f224f to your computer and use it in GitHub Desktop.
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