Exception in thread "main" java.lang.ClassCastException: Day16_TreeMap.Star cannot be cast to java.lang.Comparable
提示类型转换错误,
public static void main(String[] args) {
TreeMap<Star, String> Tr = new TreeMap<Star,String>();
//下句出错
Tr.put(new Star("刘诗诗",22,"女"), "s001");
star类重写了compareTo方法,也提示类型转换报错
star类 书写有错,类型没有规范就到位
总结:低级错误