标签:
package cn.hello; import java.util.Arrays; /* * Arrays类 * public static String toString(int[] a) :把数组转为字符串 * public static void sort(int[] a) 对数组进行排序 * public static int binarySearch(int[] a,int key) 二分查找 * */ public class Test01 { public static void main(String[] args) { int[] arr={23,44,12,55,67}; System.out.println(Arrays.toString(arr)); Arrays.sort(arr); System.out.println(Arrays.toString(arr)); System.out.println(Arrays.binarySearch(arr,24)); } }
标签:
原文地址:http://www.cnblogs.com/chengling/p/4765758.html