package cn.meowrain;
import java.util.Arrays;
public class Main {
public static void main(String[] args){
Integer[] arr = {1,2,3,4,5,32,6,7,10,435};
Arrays.sort(arr,0,arr.length); //正序
for(Integer i : arr){
System.out.println(i);
/*
* 1
2
3
4
5
6
7
10
32
435
*/
}
Arrays.sort(arr, (a, b) -> b-a ); //倒序
for(Integer i : arr){
System.out.println(i);
/*
* 435
32
10
7
6
5
4
3
2
1
*
*
*/
}
}
}