Exception in thread "main" java.lang.ClassCastException: day16.Student
at java.util.TreeMap.compare(TreeMap.java:1093)
at java.util.TreeMap.put(TreeMap.java:465)
at java.util.TreeSet.add(TreeSet.java:210)
at day16.SetStudy.main(SetStudy.java:11)
Student类中若没有实现Comparable接口在运行时就会抛出异常
实现java.util.Comparator接口也不行,必须实现Comparable接口