반응형 소스코드탐험1 [Java] 소스코드 탐험- Iterator 처음으로 살펴볼 소스코드는 Iterator. 주로 List, Set등 Collection 프레임 워크에서 특정 객체를 삭제하고 싶을 때 사용했었다. 자바 1.8부터 지원하는 removeif라는 method를 통해서 쉽게 없앨 수 있는데... 있는줄도 모르고 Iterator를 사용했었다. 쨋든 Iterator ㄱ.ㄱ public interface Iterator { boolean hasNext(); //원소가 더 있으면 true E next(); // 다음 원소 return, 원소가 더 없으면 NoSuchElementException 리턴 /** * The behavior of an iterator is unspecified if the underlying collection * is modified wh.. Java 2023. 7. 23. 이전 1 다음 반응형