equlsHashCode #java1 EqulsHashCodeTest package kr.or.ddit.basic; import java.util.HashSet; import java.util.Objects; public class EqulsHashCodeTest { public static void main(String[] args) { Person p1 = new Person(); p1.setId(1); p1.setName("홍길동"); Person p2 = new Person(); //p2.setId(2); //p2.setName("일지매"); p2.setId(1); p2.setName("홍길동"); Person p3 = p1; System.out.println(p1 == p2); System.out.println(p1 == p3); System.out.println.. 2023. 6. 22. 이전 1 다음