DthingApi
Static Public Member Functions | List of all members
java.util.Arrays Class Reference

Static Public Member Functions

static int binarySearch (byte[] array, byte value)
 
static int binarySearch (byte[] array, int startIndex, int endIndex, byte value)
 
static int binarySearch (char[] array, char value)
 
static int binarySearch (char[] array, int startIndex, int endIndex, char value)
 
static int binarySearch (double[] array, double value)
 
static int binarySearch (double[] array, int startIndex, int endIndex, double value)
 
static int binarySearch (float[] array, float value)
 
static int binarySearch (float[] array, int startIndex, int endIndex, float value)
 
static int binarySearch (int[] array, int value)
 
static int binarySearch (int[] array, int startIndex, int endIndex, int value)
 
static int binarySearch (long[] array, long value)
 
static int binarySearch (long[] array, int startIndex, int endIndex, long value)
 
static int binarySearch (Object[] array, Object value)
 
static int binarySearch (Object[] array, int startIndex, int endIndex, Object value)
 
static< T > int binarySearch (T[] array, T value, Comparator<? super T > comparator)
 
static< T > int binarySearch (T[] array, int startIndex, int endIndex, T value, Comparator<? super T > comparator)
 
static int binarySearch (short[] array, short value)
 
static int binarySearch (short[] array, int startIndex, int endIndex, short value)
 
static void fill (byte[] array, byte value)
 
static void fill (byte[] array, int start, int end, byte value)
 
static void fill (short[] array, short value)
 
static void fill (short[] array, int start, int end, short value)
 
static void fill (char[] array, char value)
 
static void fill (char[] array, int start, int end, char value)
 
static void fill (int[] array, int value)
 
static void fill (int[] array, int start, int end, int value)
 
static void fill (long[] array, long value)
 
static void fill (long[] array, int start, int end, long value)
 
static void fill (float[] array, float value)
 
static void fill (float[] array, int start, int end, float value)
 
static void fill (double[] array, double value)
 
static void fill (double[] array, int start, int end, double value)
 
static void fill (boolean[] array, boolean value)
 
static void fill (boolean[] array, int start, int end, boolean value)
 
static void fill (Object[] array, Object value)
 
static void fill (Object[] array, int start, int end, Object value)
 
static int hashCode (boolean[] array)
 
static int hashCode (int[] array)
 
static int hashCode (short[] array)
 
static int hashCode (char[] array)
 
static int hashCode (byte[] array)
 
static int hashCode (long[] array)
 
static int hashCode (float[] array)
 
static int hashCode (double[] array)
 
static int hashCode (Object[] array)
 
static boolean equals (byte[] array1, byte[] array2)
 
static boolean equals (short[] array1, short[] array2)
 
static boolean equals (char[] array1, char[] array2)
 
static boolean equals (int[] array1, int[] array2)
 
static boolean equals (long[] array1, long[] array2)
 
static boolean equals (float[] array1, float[] array2)
 
static boolean equals (double[] array1, double[] array2)
 
static boolean equals (boolean[] array1, boolean[] array2)
 
static boolean equals (Object[] array1, Object[] array2)
 
static void sort (byte[] array)
 
static void sort (byte[] array, int start, int end)
 
static void checkOffsetAndCount (int arrayLength, int offset, int count)
 
static void checkStartAndEnd (int len, int start, int end)
 
static void sort (char[] array)
 
static void sort (char[] array, int start, int end)
 
static void sort (double[] array)
 
static void sort (double[] array, int start, int end)
 
static void sort (float[] array)
 
static void sort (float[] array, int start, int end)
 
static void sort (int[] array)
 
static void sort (int[] array, int start, int end)
 
static void sort (long[] array)
 
static void sort (long[] array, int start, int end)
 
static void sort (short[] array)
 
static void sort (short[] array, int start, int end)
 
static void sort (Object[] array)
 
static void sort (Object[] array, int start, int end)
 
static< T > void sort (T[] array, int start, int end, Comparator<? super T > comparator)
 
static< T > void sort (T[] array, Comparator<? super T > comparator)
 
static String toString (boolean[] array)
 
static String toString (byte[] array)
 
static String toString (char[] array)
 
static String toString (double[] array)
 
static String toString (float[] array)
 
static String toString (int[] array)
 
static String toString (long[] array)
 
static String toString (short[] array)
 
static String toString (Object[] array)
 
static boolean [] copyOf (boolean[] original, int newLength)
 
static byte [] copyOf (byte[] original, int newLength)
 
static char [] copyOf (char[] original, int newLength)
 
static double [] copyOf (double[] original, int newLength)
 
static float [] copyOf (float[] original, int newLength)
 
static int [] copyOf (int[] original, int newLength)
 
static long [] copyOf (long[] original, int newLength)
 
static short [] copyOf (short[] original, int newLength)
 
static boolean [] copyOfRange (boolean[] original, int start, int end)
 
static byte [] copyOfRange (byte[] original, int start, int end)
 
static char [] copyOfRange (char[] original, int start, int end)
 
static double [] copyOfRange (double[] original, int start, int end)
 
static float [] copyOfRange (float[] original, int start, int end)
 
static int [] copyOfRange (int[] original, int start, int end)
 
static long [] copyOfRange (long[] original, int start, int end)
 
static short [] copyOfRange (short[] original, int start, int end)
 

Detailed Description

Arrays

contains static methods which operate on arrays.

Since
1.2

Member Function Documentation

◆ binarySearch() [1/18]

static int java.util.Arrays.binarySearch ( byte []  array,
byte  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [2/18]

static int java.util.Arrays.binarySearch ( byte []  array,
int  startIndex,
int  endIndex,
byte  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [3/18]

static int java.util.Arrays.binarySearch ( char []  array,
char  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [4/18]

static int java.util.Arrays.binarySearch ( char []  array,
int  startIndex,
int  endIndex,
char  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [5/18]

static int java.util.Arrays.binarySearch ( double []  array,
double  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [6/18]

static int java.util.Arrays.binarySearch ( double []  array,
int  startIndex,
int  endIndex,
double  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [7/18]

static int java.util.Arrays.binarySearch ( float []  array,
float  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [8/18]

static int java.util.Arrays.binarySearch ( float []  array,
int  startIndex,
int  endIndex,
float  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [9/18]

static int java.util.Arrays.binarySearch ( int []  array,
int  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [10/18]

static int java.util.Arrays.binarySearch ( int []  array,
int  startIndex,
int  endIndex,
int  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [11/18]

static int java.util.Arrays.binarySearch ( long []  array,
long  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [12/18]

static int java.util.Arrays.binarySearch ( long []  array,
int  startIndex,
int  endIndex,
long  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [13/18]

static int java.util.Arrays.binarySearch ( Object []  array,
Object  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
ClassCastExceptionif an element in the array or the search element does not implement
Comparable
, or cannot be compared to each other.

◆ binarySearch() [14/18]

static int java.util.Arrays.binarySearch ( Object []  array,
int  startIndex,
int  endIndex,
Object  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
ClassCastExceptionif an element in the array or the search element does not implement
Comparable
, or cannot be compared to each other.
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [15/18]

static <T> int java.util.Arrays.binarySearch ( T []  array,
value,
Comparator<? super T >  comparator 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, using

comparator

to compare elements. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
comparatorthe
Comparator
used to compare the elements.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
ClassCastExceptionif an element in the array or the search element does not implement
Comparable
, or cannot be compared to each other.

◆ binarySearch() [16/18]

static <T> int java.util.Arrays.binarySearch ( T []  array,
int  startIndex,
int  endIndex,
value,
Comparator<? super T >  comparator 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive), using

comparator

to compare elements. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
comparatorthe
Comparator
used to compare the elements.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
ClassCastExceptionif an element in the array or the search element does not implement
Comparable
, or cannot be compared to each other.
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ binarySearch() [17/18]

static int java.util.Arrays.binarySearch ( short []  array,
short  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.

◆ binarySearch() [18/18]

static int java.util.Arrays.binarySearch ( short []  array,
int  startIndex,
int  endIndex,
short  value 
)
inlinestatic

Performs a binary search for

value

in the ascending sorted array

array

, in the range specified by fromIndex (inclusive) and toIndex (exclusive). Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.

Parameters
arraythe sorted array to search.
startIndexthe inclusive start index.
endIndexthe exclusive start index.
valuethe element to find.
Returns
the non-negative index of the element, or a negative index which is
-index - 1
where the element would be inserted.
Exceptions
IllegalArgumentExceptionif
startIndex > endIndex
ArrayIndexOutOfBoundsExceptionif
startIndex < 0 || endIndex > array.length
Since
1.6

◆ checkOffsetAndCount()

static void java.util.Arrays.checkOffsetAndCount ( int  arrayLength,
int  offset,
int  count 
)
inlinestatic

Checks that the range described by

offset

and

count

doesn't exceed

arrayLength

.

◆ checkStartAndEnd()

static void java.util.Arrays.checkStartAndEnd ( int  len,
int  start,
int  end 
)
inlinestatic

Checks that the range described by

start

and

end

doesn't exceed

len

.

◆ copyOf() [1/8]

static boolean [] java.util.Arrays.copyOf ( boolean []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

false

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [2/8]

static byte [] java.util.Arrays.copyOf ( byte []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

(byte) 0

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [3/8]

static char [] java.util.Arrays.copyOf ( char []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

'\\u0000'

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [4/8]

static double [] java.util.Arrays.copyOf ( double []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

0.0d

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [5/8]

static float [] java.util.Arrays.copyOf ( float []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

0.0f

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [6/8]

static int [] java.util.Arrays.copyOf ( int []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

0

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [7/8]

static long [] java.util.Arrays.copyOf ( long []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

0L

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOf() [8/8]

static short [] java.util.Arrays.copyOf ( short []  original,
int  newLength 
)
inlinestatic

Copies

newLength

elements from

original

into a new array. If

newLength

is greater than

original.length

, the result is padded with the value

(short) 0

.

Parameters
originalthe original array
newLengththe length of the new array
Returns
the new array
Exceptions
NegativeArraySizeExceptionif
newLength < 0
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [1/8]

static boolean [] java.util.Arrays.copyOfRange ( boolean []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

false

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [2/8]

static byte [] java.util.Arrays.copyOfRange ( byte []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

(byte) 0

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [3/8]

static char [] java.util.Arrays.copyOfRange ( char []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

'\\u0000'

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [4/8]

static double [] java.util.Arrays.copyOfRange ( double []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

0.0d

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [5/8]

static float [] java.util.Arrays.copyOfRange ( float []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

0.0f

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [6/8]

static int [] java.util.Arrays.copyOfRange ( int []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

0

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [7/8]

static long [] java.util.Arrays.copyOfRange ( long []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

0L

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ copyOfRange() [8/8]

static short [] java.util.Arrays.copyOfRange ( short []  original,
int  start,
int  end 
)
inlinestatic

Copies elements from

original

into a new array, from indexes start (inclusive) to end (exclusive). The original order of elements is preserved. If

end

is greater than

original.length

, the result is padded with the value

(short) 0

.

Parameters
originalthe original array
startthe start index, inclusive
endthe end index, exclusive
Returns
the new array
Exceptions
ArrayIndexOutOfBoundsExceptionif
start < 0 || start > original.length
IllegalArgumentExceptionif
start > end
NullPointerExceptionif
original == null
Since
1.6

◆ equals() [1/9]

static boolean java.util.Arrays.equals ( byte []  array1,
byte []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
byte
array.
array2the second
byte
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [2/9]

static boolean java.util.Arrays.equals ( short []  array1,
short []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
short
array.
array2the second
short
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [3/9]

static boolean java.util.Arrays.equals ( char []  array1,
char []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
char
array.
array2the second
char
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [4/9]

static boolean java.util.Arrays.equals ( int []  array1,
int []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
int
array.
array2the second
int
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [5/9]

static boolean java.util.Arrays.equals ( long []  array1,
long []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
long
array.
array2the second
long
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [6/9]

static boolean java.util.Arrays.equals ( float []  array1,
float []  array2 
)
inlinestatic

Compares the two arrays. The values are compared in the same manner as

Float.equals()

.

Parameters
array1the first
float
array.
array2the second
float
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.
See also
Float::equals(Object)

◆ equals() [7/9]

static boolean java.util.Arrays.equals ( double []  array1,
double []  array2 
)
inlinestatic

Compares the two arrays. The values are compared in the same manner as

Double.equals()

.

Parameters
array1the first
double
array.
array2the second
double
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.
See also
Double::equals(Object)

◆ equals() [8/9]

static boolean java.util.Arrays.equals ( boolean []  array1,
boolean []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
boolean
array.
array2the second
boolean
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal,
false
otherwise.

◆ equals() [9/9]

static boolean java.util.Arrays.equals ( Object []  array1,
Object []  array2 
)
inlinestatic

Compares the two arrays.

Parameters
array1the first
Object
array.
array2the second
Object
array.
Returns
true
if both arrays are
null
or if the arrays have the same length and the elements at each index in the two arrays are equal according to ,
false
otherwise.

◆ fill() [1/18]

static void java.util.Arrays.fill ( byte []  array,
byte  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
byte
array to fill.
valuethe
byte
element.

◆ fill() [2/18]

static void java.util.Arrays.fill ( byte []  array,
int  start,
int  end,
byte  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
byte
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
byte
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [3/18]

static void java.util.Arrays.fill ( short []  array,
short  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
short
array to fill.
valuethe
short
element.

◆ fill() [4/18]

static void java.util.Arrays.fill ( short []  array,
int  start,
int  end,
short  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
short
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
short
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [5/18]

static void java.util.Arrays.fill ( char []  array,
char  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
char
array to fill.
valuethe
char
element.

◆ fill() [6/18]

static void java.util.Arrays.fill ( char []  array,
int  start,
int  end,
char  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
char
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
char
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [7/18]

static void java.util.Arrays.fill ( int []  array,
int  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
int
array to fill.
valuethe
int
element.

◆ fill() [8/18]

static void java.util.Arrays.fill ( int []  array,
int  start,
int  end,
int  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
int
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
int
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [9/18]

static void java.util.Arrays.fill ( long []  array,
long  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
long
array to fill.
valuethe
long
element.

◆ fill() [10/18]

static void java.util.Arrays.fill ( long []  array,
int  start,
int  end,
long  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
long
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
long
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [11/18]

static void java.util.Arrays.fill ( float []  array,
float  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
float
array to fill.
valuethe
float
element.

◆ fill() [12/18]

static void java.util.Arrays.fill ( float []  array,
int  start,
int  end,
float  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
float
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
float
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [13/18]

static void java.util.Arrays.fill ( double []  array,
double  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
double
array to fill.
valuethe
double
element.

◆ fill() [14/18]

static void java.util.Arrays.fill ( double []  array,
int  start,
int  end,
double  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
double
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
double
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [15/18]

static void java.util.Arrays.fill ( boolean []  array,
boolean  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
boolean
array to fill.
valuethe
boolean
element.

◆ fill() [16/18]

static void java.util.Arrays.fill ( boolean []  array,
int  start,
int  end,
boolean  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
boolean
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
boolean
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ fill() [17/18]

static void java.util.Arrays.fill ( Object []  array,
Object  value 
)
inlinestatic

Fills the specified array with the specified element.

Parameters
arraythe
Object
array to fill.
valuethe
Object
element.

◆ fill() [18/18]

static void java.util.Arrays.fill ( Object []  array,
int  start,
int  end,
Object  value 
)
inlinestatic

Fills the specified range in the array with the specified element.

Parameters
arraythe
Object
array to fill.
startthe first index to fill.
endthe last + 1 index to fill.
valuethe
Object
element.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ hashCode() [1/9]

static int java.util.Arrays.hashCode ( boolean []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

boolean

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Boolean instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [2/9]

static int java.util.Arrays.hashCode ( int []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two not-null

int

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Integer instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [3/9]

static int java.util.Arrays.hashCode ( short []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

short

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Short instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [4/9]

static int java.util.Arrays.hashCode ( char []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

char

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Character instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [5/9]

static int java.util.Arrays.hashCode ( byte []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

byte

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Byte instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [6/9]

static int java.util.Arrays.hashCode ( long []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

long

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Long instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [7/9]

static int java.util.Arrays.hashCode ( float []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

float

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Float instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [8/9]

static int java.util.Arrays.hashCode ( double []  array)
inlinestatic

Returns a hash code based on the contents of the given array. For any two

double

arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the List#hashCode() method which is invoked on a List containing a sequence of Double instances representing the elements of array in the same order. If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ hashCode() [9/9]

static int java.util.Arrays.hashCode ( Object []  array)
inlinestatic

Returns a hash code based on the contents of the given array. If the array contains other arrays as its elements, the hash code is based on their identities not their contents. So it is acceptable to invoke this method on an array that contains itself as an element, either directly or indirectly.

For any two arrays

a

and

b

, if

Arrays.equals(a, b)

returns

true

, it means that the return value of

Arrays.hashCode(a)

equals

Arrays.hashCode(b)

.

The value returned by this method is the same value as the method Arrays.asList(array).hashCode(). If the array is

null

, the return value is 0.

Parameters
arraythe array whose hash code to compute.
Returns
the hash code for
array
.

◆ sort() [1/18]

static void java.util.Arrays.sort ( byte []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
byte
array to be sorted.

◆ sort() [2/18]

static void java.util.Arrays.sort ( byte []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order.

Parameters
arraythe
byte
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [3/18]

static void java.util.Arrays.sort ( char []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
char
array to be sorted.

◆ sort() [4/18]

static void java.util.Arrays.sort ( char []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order.

Parameters
arraythe
char
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [5/18]

static void java.util.Arrays.sort ( double []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
double
array to be sorted.
See also
#sort(double[], int, int)

◆ sort() [6/18]

static void java.util.Arrays.sort ( double []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order. The values are sorted according to the order imposed by

Double.compareTo()

.

Parameters
arraythe
double
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.
See also
Double::compareTo(Double)

◆ sort() [7/18]

static void java.util.Arrays.sort ( float []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
float
array to be sorted.
See also
#sort(float[], int, int)

◆ sort() [8/18]

static void java.util.Arrays.sort ( float []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order. The values are sorted according to the order imposed by

Float.compareTo()

.

Parameters
arraythe
float
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.
See also
Float::compareTo(Float)

◆ sort() [9/18]

static void java.util.Arrays.sort ( int []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
int
array to be sorted.

◆ sort() [10/18]

static void java.util.Arrays.sort ( int []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order.

Parameters
arraythe
int
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [11/18]

static void java.util.Arrays.sort ( long []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
long
array to be sorted.

◆ sort() [12/18]

static void java.util.Arrays.sort ( long []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order.

Parameters
arraythe
long
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [13/18]

static void java.util.Arrays.sort ( short []  array)
inlinestatic

Sorts the specified array in ascending numerical order.

Parameters
arraythe
short
array to be sorted.

◆ sort() [14/18]

static void java.util.Arrays.sort ( short []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending numerical order.

Parameters
arraythe
short
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [15/18]

static void java.util.Arrays.sort ( Object []  array)
inlinestatic

A comparator that implements the natural order of a group of mutually comparable elements. Using this comparator saves us from duplicating most of the code in this file (one version for Comparables, one for explicit comparators). Sorts the specified array in ascending natural order.

Parameters
arraythe
Object
array to be sorted.
Exceptions
ClassCastExceptionif an element in the array does not implement
Comparable
or if some elements cannot be compared to each other.
See also
#sort(Object[], int, int)

◆ sort() [16/18]

static void java.util.Arrays.sort ( Object []  array,
int  start,
int  end 
)
inlinestatic

Sorts the specified range in the array in ascending natural order. All elements must implement the

Comparable

interface and must be comparable to each other without a

ClassCastException

being thrown.

Parameters
arraythe
Object
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
Exceptions
ClassCastExceptionif an element in the array does not implement
Comparable
or some elements cannot be compared to each other.
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [17/18]

static <T> void java.util.Arrays.sort ( T []  array,
int  start,
int  end,
Comparator<? super T >  comparator 
)
inlinestatic

Sorts the specified range in the array using the specified

Comparator

. All elements must be comparable to each other without a

ClassCastException

being thrown.

Parameters
arraythe
Object
array to be sorted.
startthe start index to sort.
endthe last + 1 index to sort.
comparatorthe
Comparator
.
Exceptions
ClassCastExceptionif elements in the array cannot be compared to each other using the
Comparator
.
IllegalArgumentExceptionif
start > end
.
ArrayIndexOutOfBoundsExceptionif
start < 0
or
end > array.length
.

◆ sort() [18/18]

static <T> void java.util.Arrays.sort ( T []  array,
Comparator<? super T >  comparator 
)
inlinestatic

Sorts the specified array using the specified

Comparator

. All elements must be comparable to each other without a

ClassCastException

being thrown.

Parameters
arraythe
Object
array to be sorted.
comparatorthe
Comparator
.
Exceptions
ClassCastExceptionif elements in the array cannot be compared to each other using the
Comparator
.

◆ toString() [1/9]

static String java.util.Arrays.toString ( boolean []  array)
inlinestatic

Creates a

String

representation of the

boolean[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(boolean) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
boolean
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [2/9]

static String java.util.Arrays.toString ( byte []  array)
inlinestatic

Creates a

String

representation of the

byte[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(int) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
byte
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [3/9]

static String java.util.Arrays.toString ( char []  array)
inlinestatic

Creates a

String

representation of the

char[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(char) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
char
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [4/9]

static String java.util.Arrays.toString ( double []  array)
inlinestatic

Creates a

String

representation of the

double[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(double) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
double
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [5/9]

static String java.util.Arrays.toString ( float []  array)
inlinestatic

Creates a

String

representation of the

float[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(float) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
float
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [6/9]

static String java.util.Arrays.toString ( int []  array)
inlinestatic

Creates a

String

representation of the

int[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(int) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
int
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [7/9]

static String java.util.Arrays.toString ( long []  array)
inlinestatic

Creates a

String

representation of the

long[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(long) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
long
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [8/9]

static String java.util.Arrays.toString ( short []  array)
inlinestatic

Creates a

String

representation of the

short[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(int) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
short
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

◆ toString() [9/9]

static String java.util.Arrays.toString ( Object []  array)
inlinestatic

Creates a

String

representation of the

Object[]

passed. The result is surrounded by brackets (

"[]"

), each element is converted to a

String

via the String#valueOf(Object) and separated by

", "

. If the array is

null

, then

"null"

is returned.

Parameters
arraythe
Object
array to convert.
Returns
the
String
representation of
array
.
Since
1.5

The documentation for this class was generated from the following file: