array slice view java code example Example: array slice java int[] newArray = Arrays.copyOfRange(oldArray, startIndex, endIndex);