ArrayList 의 메소드중에
clear 와 removeAll 의차이점은 뭔가요?
둘다 아이템을 모두삭제한다는뜻인것같은데
어느것을 선택해서사용해야되는지...
그리고
키 와 배류 값의쌍을 저장하는 컬렉션은 뭐가있나요?
api 문서를 보면 아래와 같이 설명되어 있습니다.
clear()
Removes all of the elements from this list.
removeAll(Collection<?> c)
Removes from this list all of its elements that are contained in the specified collection.
clear 는 ArrayList 안의 모든 값을 바로 지우는것.
removeAll 은 전달받은 Collection 안에 있는 요소만 지우는것.
removeAll 은 http://blog.ggaman.com/799 여기에 잘 설명되어 있습니다.
키와 밸류로 값을 저장한는 방법은 아래 링크 참고 하세요~
http://pelican7.egloos.com/881589
많은도움되었습니다
답변감사합니다
로그인 유지
api 문서를 보면 아래와 같이 설명되어 있습니다.
clear()
Removes all of the elements from this list.
removeAll(Collection<?> c)
Removes from this list all of its elements that are contained in the specified collection.
clear 는 ArrayList 안의 모든 값을 바로 지우는것.
removeAll 은 전달받은 Collection 안에 있는 요소만 지우는것.
removeAll 은 http://blog.ggaman.com/799 여기에 잘 설명되어 있습니다.
키와 밸류로 값을 저장한는 방법은 아래 링크 참고 하세요~
http://pelican7.egloos.com/881589