HashSet 사용 방법 (개념, 특징, 메소드 및 예제)
1. HashSet이란?HashSet은 중복되지 않는 데이터를 순서에 상관없이 저장합니다. 2. HashSet 생성 방법HashSet 변수명 = new HashSet(); HashSet set1 = new HashSet();//HashSet생성HashSet set2 = new HashSet();//new에서 타입 파라미터 생략가능HashSet set3 = new HashSet(set1);//set1의 모든 값을 가진 HashSet생성 HashSet set4 = new HashSet(10);//초기 용량(capacity)지정 HashSet set5 = new HashSet(10, 0.7f);//초기 capacity,load factor지정 HashSet set6 = new HashSet(Arrays.asL..
2024.05.08