Arrays 类的一些常见用法

package cn.ljs;

import java.util.Arrays;

public class ArrayDemo {

    public static void main(String [] args){

        int [] arr1 = {,,};
int [] arr2 = {,,,,};
System.out.println(Arrays.equals(arr1,arr2)); // 简单说比较两数组形状相同不 System.out.println(Arrays.toString(arr1)); // toString Arrays.sort(arr2);
System.out.println(Arrays.toString(arr2)); Arrays.fill(arr1,-); // 填充-1
System.out.println(Arrays.toString(arr1)); int index = Arrays.binarySearch(arr2,); // 排序
System.out.println(index); int [] b = Arrays.copyOf(arr1, arr1.length); //copy 数组
System.out.println(arr1 == b);
}
}
上一篇:CSS基础 阴影相关属性设置


下一篇:解决WebSphere异常:SRVE0199E: 已获取了 OutputStream