介绍 代码 package lesson.l8_arrays;import java.util.Arrays;/*** Illustration** @author DengQing* @version 1.0* @datetime 2022/6/23 16:53* @function Arrays数组工具类*/ public class ArraysUtil {public static void main(String[] args) {int[] arr1 = new int[]{1, 12, -3, -4, 10, 11, 7123844, -1, 2};int[] arr2 = new int[]{1, 12, -3, -4, 10, 11, 7123844, -1, 2}; // 1.判读两个数组是否相等System.out.println(Arrays.equals(arr1, arr2)); // 2.输出数组信息System.out.println(Arrays.toString(arr1)); // 3.全部替换fillArrays.fill(arr1, -10);System.out.println(Arrays.toString(arr1)); // 4.从小到大排序Arrays.sort(arr2);System.out.println(Arrays.toString(arr2)); // 5.二分查找int index = Arrays.binarySearch(arr2, -3);System.out.println(index > 0 ? index : "没有找到");} }