标题: 为什么我treeset总有红线,照着打的,倒包也没用 [打印本页] 作者: danielchung6600 时间: 2016-6-21 23:20 标题: 为什么我treeset总有红线,照着打的,倒包也没用 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;
}
});