Java数组和字符串:Array类的使用

在学习一维数组过程中有一个类不得不学,因为它提供了数组的常用操作。
【Arrays类提供的数组常用操作】

  1. 数组排序
static void sort(X[]a)

对指定的X型数组按数字升序进行排序。

static void sort(X[] a,int fromIndex,int toIndex)
  1. 查找指定元素
public static int binarySearch(X[] a,X key)
  1. 比较数组中的元素
equls

猜你喜欢

转载自blog.csdn.net/m0_46700215/article/details/106321063