Skip to content

Instantly share code, notes, and snippets.

@takahashi-h5
Created August 31, 2019 10:46
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 takahashi-h5/c993817a682d4437c90ebadde1c29e80 to your computer and use it in GitHub Desktop.
Save takahashi-h5/c993817a682d4437c90ebadde1c29e80 to your computer and use it in GitHub Desktop.
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