标签:sort oid 复制 bin ring arch als tostring rgs
1 public static void main(String[] args) { 2 //1.数组复制 3 int[] a = {10,33,28,22,55,78}; 4 int[] ints = Arrays.copyOfRange(a, 0, 3); 5 for (int anInt : ints) { 6 System.out.println(anInt); 7 } 8 //2.数组排序 9 Arrays.sort(a); 10 //3.数组转字符串 11 System.out.println(Arrays.toString(a)); 12 //4.数组二分查找,查找之前要先进行排序 13 System.out.println(Arrays.binarySearch(a,55)); 14 //5.判断数组是不是相等 15 int[] b = {10,33,28,22,55,99}; 16 System.out.println(Arrays.equals(a,b)); 17 //6.数组填充 18 int[] c = new int[10]; 19 Arrays.fill(c,5); 20 System.out.println(Arrays.toString(c)); 21 22 }
标签:sort oid 复制 bin ring arch als tostring rgs
原文地址:https://www.cnblogs.com/learn-mantou/p/14032687.html