Last active
June 10, 2018 05:20
-
-
Save LeoHeo/503644e401bc0c71eee61bf3578e0101 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
@Override | |
public int hashCode() { | |
return Objects.hash(getId()); | |
} |
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
Set<Student> studentSet = new HashSet<>(); | |
studentSet.add(leo1); | |
studentSet.add(new Student(1L, "Leo")); | |
System.out.println("studentSet size => " + studentSet.size()); // studentSet size => 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment