java-se - Java TreeSet的比较器排序的疑问?
PHP中文网
PHP中文网 2017-04-18 10:50:51
0
1
742

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
刘奇

You need to write the class you marked and rewrite the compareTo() method in it. What is implemented in the method is the comparison method you need. For example, if you want to compare based on students' names, you can just write the comparison method of the names in it. You can see how its default comparison method is implemented and you will understand. There is no change in the creation of collection objects.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template