相关疑难解决方法(0)

使用 Arrays.sort() 方法对类型对象的数组进行排序

我知道如何使用 Arrays.sort() 方法按以下方式对对象数组进行排序。

Arrays.sort(array of primitive type);   
Arrays.sort(array of primitive type, from, to); 
Arrays.sort(array of an object type);   
Arrays.sort(array of an object type , from, to);    
Run Code Online (Sandbox Code Playgroud)

但我不知道以下两种方法。

Arrays.sort(array of an object type , comparator);  
Arrays.sort(array of an object type , from, to, comparator);    
Run Code Online (Sandbox Code Playgroud)

有人可以让我知道如何使用这些方法对类型对象的数组进行排序吗?我请求您添加代码或任何指向 .java 类的链接。我尝试搜索它但找不到它。

谢谢。

java sorting comparison

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

comparison ×1

java ×1

sorting ×1