Check out example codes for "take a peice from array java". It will help you in understanding the concepts better.

Code Example 1

import java.util.IntStream;
// for java 8 and 8+
IntStream.range(start, end).map(x -> arr[x]).toArray();

Learn ReactJs, React Native from akashmittal.com