//arrays工具类的使用
int[] number = new int[]{1,2,3,4};
int[] numbers = new int[]{1,2,3,4};
//是否相等
boolean isequal= Arrays.equals(number,numbers);
System.out.println(isequal);
//直接输出信息
System.out.println(Arrays.toString(number));
//将数组全部改成一个元素
Arrays.fill(number,10);
System.out.println(Arrays.toString(number));
//排序
Arrays.sort(numbers);
System.out.println(Arrays.toString(numbers));
//二分查找,前提数组有序,否则报错
int index= Arrays.binarySearch(numbers,4);
if(index>0){
System.out.println(index);
}
标签:arrays,System,number,Arrays,int,numbers,工具,out
From: https://www.cnblogs.com/tgfoven/p/17024981.html