Answers for "how to sort the arraylist without changing the original arraylist"

0

how to sort the arraylist without changing the original arraylist

ArrayList<String> original = new ArrayList<>();
ArrayList<String> copy = new ArrayList<>(original);
copy.sort(Comparator.naturalOrder());
Posted by: Guest on March-25-2021

Code answers related to "how to sort the arraylist without changing the original arraylist"

Browse Popular Code Answers by Language