There is an ArrayList which stores integer values. Suppose the arrayList stored values are: 10, 20, 30, 40, 50.
I know how to find the maximum value of the collection. I would have to do:
Collections.max(arrayList);
But what should I do to find the maximum of the first 3 elements of the collection? So in this example, it would be 30. Is there a sublist function for collections?