Arrays.sort()
index=Arrays.binarySearch(array,2)
分段数组复制
System.arraycopy(original,
0
, destination,
0
, index);
数组反转
Collections.reverse(arrayList);
数组最大值,最小值
int
min = (
int
) Collections.min(Arrays.asList(numbers));
int
max = (
int
) Collections.max(Arrays.asList(numbers));
arraytoList:List list =
new
ArrayList(Arrays.asList(a));
list.addAll(Arrays.asList(b));
数组合并
Object[] c = list.toArray();
数组填充
Arrays.fill(array,
100
);
Arrays.fill(array,
3
,
6
,
50
);
起点结束点,结束点不包括
数组扩容:
System.arraycopy(names,
0
, extended,
0
, names.length);
前面粘贴到后面
ArrayList.remove()
ArrayList.removeAll() 求差
objArray2.add(0,"common1"); objArray2.add(1,"common2"); objArray2.add(2,"notcommon"); objArray2.add(3,"notcommon1"); objArray.add(0,"common1"); objArray.add(1,"common2"); objArray.add(2,"notcommon2"); System.out.println("array1 的元素" +objArray); System.out.println("array2 的元素" +objArray2); objArray.removeAll(objArray2);
ArrayList.retainAll () 求交集
ArrayList.contains()
Arrays.equals(a,b)