Created
August 31, 2019 10:46
-
-
Save takahashi-h5/c993817a682d4437c90ebadde1c29e80 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 Main { | |
public static void main(String[] args) { | |
Employee emp1 = new Employee(10, "takahashi"); | |
Employee emp2 = new Employee(20, "takahashi"); | |
System.out.println(emp1.equals(emp2)); // nameだけで同値なのでtrueとなる | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment