728x90
반응형

JAVA 260

[JAVA] ArrayList remove()

https://codechacha.com/ko/java-collections-arraylist-remove/ Java - ArrayList.remove() 사용 방법 및 예제 ArrayList의 remove()는 리스트의 객체를 삭제하는데 사용되는 메소드입니다. ArrayList.remove(int index)는 인자로 전달된 인덱스의 아이템을 리스트에서 삭제합니다. ArrayList.remove(Object o)는 인자와 동일한 codechacha.com ArrayList list = [ 1, 2, "1", 3, 4, 5 ]; 에서 1을 삭제하려고 할 때, list.remove(1); 이렇게하면 1 은 index로 작용하여 숫자 2가 삭제된다. list.remove( new Integer(1)); 하고..

JAVA 2023.12.02
728x90
반응형