August 2018
Beginner
178 pages
4h 56m
English
This function sorts the collection by their natural sort order. It can only be called if the generic type parameter implements the Comparable<T> interface:
val numbers = listOf(2, 1, 5, 3, 4)val sorted = numbers.sorted()
Read now
Unlock full access