Shorten array length once element is remove in Java

前端 未结 5 1799
庸人自扰
庸人自扰 2021-01-13 10:00

Note: Following is my homework/assignment, feel free not to answer if you will.

I want to delete/remove an element from an String array(Set) basic, I\'m not allowe

5条回答
  •  温柔的废话
    2021-01-13 10:38

    The size of an array in Java can't be changed once the array is created. The following links should help you with transferring the existing items to a new array :-)

    See: System.arraycopy and Array.copyOf(*).

提交回复
热议问题