Created
September 12, 2014 07:30
-
-
Save bjpeterdelacruz/017ffcc9a364f2171267 to your computer and use it in GitHub Desktop.
Person
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 { | |
private final int age; | |
public Person(int age) { this.age = age; } | |
@Override | |
public boolean equals(Object obj) { | |
return (obj instanceof Person) && this.age == ((Person) obj).age; | |
} | |
@Override | |
public boolean hashCode() { return 21; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment