가장 좋은 선택은 객체 컬렉션을 사용하는 것입니다. 요소는 위치 오프셋이 -1.
public void removeElement(Object[] a, int del) {
System.arraycopy(a,del+1,a,del,a.length-1-del);
}
Apache Commons
공용 lang의 라이브러리를 사용할 수도 있습니다ArrayUtils.array = ArrayUtils.removeElement(배열, 요소)Resources:
https://stackoverflow.com/questions/642897/removing-an-element-from-an-array-java
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...