Iterator it = ts.iterator();
while(it.hasNext())
{
System.out.println(it.next());
}
}
}
/*
//自定义类实现Comarator接口,具备比较功能
class StrLenComparator implements Comparator
{
public int compare(Object o1,Object o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int num = new Integer(s1.length()).compareTo(new Integer(s2.length()));
if(num==0)
return s1.compareTo(s2);