Exception in thread "main" java.lang.ClassCastException: Day16_TreeMap.Star cannot be cast to java.lang.Comparable
提示类型转换错误,
public static void main(String[] args) {
TreeMap Tr = new TreeMap();
//下句出错
Tr.put(new Star("刘诗诗",22,"女"), "s001");
star类重写了compareTo方法,也提示类型转换报错
star类 书写有错,类型没有规范就到位
总结:低级错误
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net