package com.sf.day05;

import java.util.Arrays;

/**
 * Arrays工具类的使用
 */
public class ArraysTest {
    public static void main(String[] args) {
        int[] aa = new int[]{4,2,3};
        System.out.println(aa);
        System.out.println(Arrays.toString(aa));
        Arrays.sort(aa);
        System.out.println(Arrays.toString(aa));
//        int[] bb = new int[]{9,8,7,6,5,4,3,2,1};
//        Arrays.sort(bb,2,7);   //左闭右开
//        System.out.println(Arrays.toString(bb));
        int[] bb = new int[]{1,2,3,4,5,6,7};
        int i = Arrays.binarySearch(bb, 7);
        System.out.println(i);

        int[] cc = new int[5];
        System.out.println(Arrays.toString(cc));
        Arrays.fill(cc,1,4,222);
        System.out.println(Arrays.toString(cc));
    }
}
