Which algorithm use sorted method in Stream interface [closed]
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Improve this question When I print the values in the sorted method, Stream.of("d", "a", "b", "e", "c", "f") .sorted((s1, s2) -> { System.out.printf("sort: %s - %s\n", s1, s2); return s1.compareTo(s2); }).forEach(System.out::println); The output is as follows; sort: a - d sort: b - a sort: b - d sort: