Comparator won't work with Arrays.sort

前端 未结 5 1215
迷失自我
迷失自我 2021-01-21 07:03

So I\'m working on a comparator problem and I can\'t figure out why the Array.sort in this first class is giving me the error of:

The method

5条回答
  •  执念已碎
    2021-01-21 07:33

    An ArrayList is different from a Java array; since you're using a List, Arrays.sort won't help you here.

    Consider Collections.sort instead.

提交回复
热议问题