copying array by value in java

前端 未结 5 995
轻奢々
轻奢々 2020-12-19 00:42

I tried to make an independent copy of an array but couldnt get one. see i cannot copy it integer by integer using a for loop because of efficiency reasons. Is there any oth

5条回答
  •  既然无缘
    2020-12-19 01:05

    Check out System.arraycopy(). It can copy arrays of any type and is a preffered(and optimized) way to copy arrays.

提交回复
热议问题