在学习一维数组过程中有一个类不得不学,因为它提供了数组的常用操作。
【Arrays类提供的数组常用操作】
- 数组排序
static void sort(X[]a)
对指定的X型数组按数字升序进行排序。
static void sort(X[] a,int fromIndex,int toIndex)
- 查找指定元素
public static int binarySearch(X[] a,X key)
- 比较数组中的元素
equls
在学习一维数组过程中有一个类不得不学,因为它提供了数组的常用操作。
【Arrays类提供的数组常用操作】
static void sort(X[]a)
对指定的X型数组按数字升序进行排序。
static void sort(X[] a,int fromIndex,int toIndex)
public static int binarySearch(X[] a,X key)
equls