package com.sf._02_arrays;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] nums = {5,2,9,1,5,6};
        Arrays.sort(nums);
        System.out.println(Arrays.toString(nums));
        System.out.println(Arrays.binarySearch(nums, new Integer(9)));
        int[] newArr = Arrays.copyOf(nums, 8);
        System.out.println(Arrays.toString(newArr));
        newArr[newArr.length-2] = 10;
        newArr[newArr.length-1] = 11;
        System.out.println(Arrays.toString(newArr));
    }
}
