数组工具
package com.ten;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] arr = new int[] {
4,5,7,8,1,2,4,5,7,4,3,6};
System.out.println(Arrays.toString(arr));
Arrays.sort(arr);
System.out.println(Arrays.toString(arr));
Arrays.fill(arr,7);
System.out.println(Arrays.toString(arr));
int[] arr2 = Arrays.copyOf(arr, arr.length);
System.out.println(Arrays.toString(arr2));
int[] arr3 = new int[10];
System.arraycopy(arr,0,arr3,5,2);
System.out.println(Arrays.toString(arr3));
System.out.println(Arrays.binarySearch(arr, 7));
int[][] arr4 = new int[][] {
{
1, 2, 3}, {
4, 5, 6}, {
7, 8, 9}};
System.out.println(Arrays.deepToString(arr4));
int[] a = new int[] {
1, 2, 3};
int[] b = new int[] {
1, 2, 3};
System.out.println(Arrays.equals(a, b));
}
}