How to sort an ArrayList<String> based on specific index range
You should do
Collections.sort(yourList.subList(1, yourList.size()));
Since the List.subList
method returns a view of the list, modifications done by Collections.sort
will affect the backing list as well.