package com.demo.aaa;
import java.util.Comparator;
public class demo2_内部类操作器 {
public static void main(String[] args) {
TreeSet<String>() s = new TreeSet<>(new Comparator<String>(){
public int compare(String s1,String s2){
int num = s2.length() - s1.length();
return num ==0?s2.compareTo(s1):num;
}
});
}
}
|
|