一、代码展示
/*
* Copyright (c) 2020, 2023, webrx.cn All rights reserved.
*
*/
package com.bbb;
import java.util.Arrays;
public class A1 {
public static void main(String[] args) {
//Lambda 表达式
Integer[] arr = {2, 3, 4, 6, 1, 9, 7, 13};
// Arrays.sort(arr);//升序
Arrays.sort(arr, (a, b) -> b - a);//降序
System.out.println(Arrays.toString(arr));
}
}
二、运行结果展示