Reversing elements with reverse()

To reverse the elements of a data structure, there comes a method reverse() from Collections class. The method reverses all the elements in the original data structure itself. That is, after this method call, the original order in the list itself changes. Following is the method. static void reverse(List list1): Existing order of the elements …

Reversing elements with reverse() Read More »