• + 0 comments

    Kind of, yes. To be more precise:

    Comparator.comparing creates a Comparator, which can be used to sort a collection or stream. If you don't provide a Comparator to the sorting method, it will rely on the natural ordering of the elements of the collection instead. A natural ordering is given only when the element class does implement the Comparable interface and in this case the ordering is defined by overriding the compareTo method.

    So, yes it does - basically.