JAVA SORT
In java to sort an array you can simply put Arrays.sort(arrayName); in the case of Arrays and to sort Collections(ArrayList,LinkedList...) we use Collections.sort(listName);.
But you can also sort by using for loop.
1. Java Sorting using for loop
Sort using for loop |
2. Java Sort Using Arrays.sort()
Sort an array using Arrays.sort() |
Comments
Post a Comment