Iterator<Woker> it = tm.iterator();
while(it.hasNext())
{
Woker stu = (Woker)it.next();
System.out.println(stu.getName()+"..."+stu.getAge()+"..."+stu.getPay());
}
}
}
class StuPayComparator implements Comparator<Woker>
{
public int compare(Woker s1,Woker s2)
{
int num = s1.getName().compareTo(s2.getName());
if(num==0)
return new Integer(s1.getPay()).compareTo(new Integer(s2.getPay()));