반응형
자바 리스트 제거
-
Java - ArrayList.removeAll() 사용법 및 예제Java 2022. 7. 7. 18:22
ArrayList의 removeAll() 메소드 인자로 전달된 Collection 아이템들과 일치하는 객체를 리스트에서 삭제 1. ArrayList.removeAll() public boolean removeAll(Collection c) parameter c는 list에서 삭제할 아이템 Collection 입니다. return value는 list가 변하면 true를 반환합니다. 2. 예제 import java.util.ArrayList; class ArrayListExample { public static void main(String[] args) { ArrayList list1 = new ArrayList(); list1.add("AA"); list1.add("BB"); list1.add("CC"..