How to use Comparator in Java to sort

后端 未结 14 2086
时光取名叫无心
时光取名叫无心 2020-11-22 02:19

I learned how to use the comparable but I\'m having difficulty with the Comparator. I am having a error in my code:

Exception in thread \"main\" java.lang.C         


        
14条回答
  •  天命终不由人
    2020-11-22 03:08

    Do not waste time implementing Sorting Algorithm by your own. Instead; use

    Collections.sort() to sort data.

提交回复
热议问题