ArrayList.subList(int startIndex, int endIndex) get the view of elements based on input range of the ArrayList. startIndex : Integer , required, the starting position of the list. endIndex : integer, required , the ending position of the list.
It returns the view of the elements within the given range.