import java.util.*;public class SortedSetDemo {
public static void main(String[] args) {
SortedSet sortedSet = new TreeSet(Arrays.asList(
"one two three four five six seven eight".split(" ")));
System.out.println(sortedSet);
}}结果是[eight, five, four, one, seven, six, three, two]上面的没有重载comparator方法,请问是如何排序的
public static void main(String[] args) {
SortedSet sortedSet = new TreeSet(Arrays.asList(
"one two three four five six seven eight".split(" ")));
System.out.println(sortedSet);
}}结果是[eight, five, four, one, seven, six, three, two]上面的没有重载comparator方法,请问是如何排序的
是的它默认实现了compareto接口。。