标签:style io ar java sp on cti bs ad
TreeSet实现了SortedSet接口
package iotest;
import java.util.SortedSet;
import java.util.TreeSet;
public class sset {
public static void main(String args[]){
SortedSet<String> alls=new TreeSet<String>();
alls.add("A");
alls.add("M");
alls.add("D");
alls.add("F");
alls.add("F");
System.out.println(alls);
System.out.println(alls.first());
System.out.println(alls.last());
System.out.println(alls.headSet("F"));
System.out.println(alls.tailSet("D"));
System.out.println(alls.subSet("D", "F"));
}
}
标签:style io ar java sp on cti bs ad
原文地址:http://blog.csdn.net/goodhuajun/article/details/40648539