Arrays Utility Class Flashcards
Creates a fixed-size List out of the given array.
List asList(T…a)
Searches for a key in the array. Returns an int value >= the index of the key if found. Otherwise returns a negative value. Overloads available for primitive types like int[] and byte[] and for a comparator object.
int binarySearch(objArray, key)
Checks if the contents of array1 and array2 are equal. Overloads available for primitive types.
boolean equals(array1, array2)
Fills the array with the value val. Overloads available for primitive types.
void fill(Array, val)
Sorts the array based on natural order. Overloads available for primitives and a comparator object.
void sort(array)
Returns the String representation of the given array.
String toString(array)