Last active
March 9, 2023 11:01
-
-
Save adojos/ab87368e0dbbc15ef598dedaec5e540a to your computer and use it in GitHub Desktop.
Java: Sort List Using Collections.sort without Comparator #java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void usingCollectionsSortNoComparator() { | |
List<Integer> input = Arrays.asList(34,12,67,8,91,54,24); | |
Collections.sort(input); | |
System.out.print("Sorted List:"); | |
input.forEach(num -> System.out.print(num+" ")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment