System.arraycopy(from, fromIndex, to, toIndex, count);
The shallowcopy starts at position 2 in the source array i.e. arr1 and copies four entries, starting at position 3 of the target array i.e. arr
arr2 = Arrays.copyOf(a, newLength);
New shallow copy of array with new length. If longer, uses default values.
arr2 = Arrays.copyOfRange(a, from, to);
New shallow copy of portion of array.
No comments:
Post a Comment