public class ExamDemo3 {
public static void main(String[] args) throws IOException{
print();
}
public static void print() throws IOException{
TreeSet <String>tm=new TreeSet<String>(new Comparator<String>() {
@Override
public int compare(String str1, String str2) {
return -(str1.compareTo(str2));
}
});
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line=null;
while((line=br.readLine())!=null){
if("end".equals(line)){
break;
}
tm.add(line);
}
}
}
为什么没有实现排序呢,到底是什么情况求大神指导
|
|