import java.util.Set;
import java.util.*;
public class Test{
public static void main(String[]args){
Set<String> set = new HashSet<String>();
set.add("ajdj");
set.add("china");
set.add("new york");
System.out.println(set);
TreeSet<String> tree = new TreeSet<String>(set);
System.out.println(tree);
}
}
TreeSet是怎么比较大小的,例如上面输出,如截图
|
|