# Array

public final class **Array** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
The `Array` class provides static methods to dynamically create and
access Java arrays.

`Array` permits widening conversions to occur during a get or set
operation, but throws an `IllegalArgumentException` if a narrowing
conversion would occur.

### Public Method Summary

|---|---|
| static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [get](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object. |
| static boolean | [getBoolean](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getBoolean(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `boolean`. |
| static byte | [getByte](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getByte(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `byte`. |
| static char | [getChar](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getChar(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `char`. |
| static double | [getDouble](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getDouble(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `double`. |
| static float | [getFloat](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getFloat(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `float`. |
| static int | [getInt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getInt(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as an `int`. |
| static int | [getLength](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getLength(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array) Returns the length of the specified array object, as an `int`. |
| static long | [getLong](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getLong(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `long`. |
| static short | [getShort](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#getShort(java.lang.Object,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index) Returns the value of the indexed component in the specified array object, as a `short`. |
| static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [newInstance](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#newInstance(java.lang.Class<?>,%20int))([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> componentType, int length) Creates a new array with the specified component type and length. |
| static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [newInstance](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#newInstance(java.lang.Class<?>,%20int...))([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> componentType, int... dimensions) Creates a new array with the specified component type and dimensions. |
| static void | [set](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value) Sets the value of the indexed component of the specified array object to the specified new value. |
| static void | [setBoolean](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setBoolean(java.lang.Object,%20int,%20boolean))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, boolean value) Sets the value of the indexed component of the specified array object to the specified `boolean` value. |
| static void | [setByte](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setByte(java.lang.Object,%20int,%20byte))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, byte value) Sets the value of the indexed component of the specified array object to the specified `byte` value. |
| static void | [setChar](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setChar(java.lang.Object,%20int,%20char))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, char value) Sets the value of the indexed component of the specified array object to the specified `char` value. |
| static void | [setDouble](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setDouble(java.lang.Object,%20int,%20double))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, double value) Sets the value of the indexed component of the specified array object to the specified `double` value. |
| static void | [setFloat](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setFloat(java.lang.Object,%20int,%20float))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, float value) Sets the value of the indexed component of the specified array object to the specified `float` value. |
| static void | [setInt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setInt(java.lang.Object,%20int,%20int))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, int value) Sets the value of the indexed component of the specified array object to the specified `int` value. |
| static void | [setLong](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setLong(java.lang.Object,%20int,%20long))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, long value) Sets the value of the indexed component of the specified array object to the specified `long` value. |
| static void | [setShort](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#setShort(java.lang.Object,%20int,%20short))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, short value) Sets the value of the indexed component of the specified array object to the specified `short` value. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Methods

#### public static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**get**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object. The value is automatically wrapped in an object
if it has a primitive type.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the (possibly wrapped) value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

#### public static boolean
**getBoolean**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `boolean`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static byte
**getByte**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `byte`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static char
**getChar**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `char`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static double
**getDouble**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `double`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static float
**getFloat**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `float`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static int
**getInt**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as an `int`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static int
**getLength**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array)

Returns the length of the specified array object, as an `int`.

##### Parameters

| array | the array |
|---|---|

##### Returns

- the length of the array

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the object argument is not an array |
|---|---|

#### public static long
**getLong**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `long`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static short
**getShort**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index)

Returns the value of the indexed component in the specified
array object, as a `short`.

##### Parameters

| array | the array |
| index | the index |
|---|---|

##### Returns

- the value of the indexed component in the specified array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object is not an array, or if the indexed element cannot be converted to the return type by an identity or widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#get(java.lang.Object,%20int)`

#### public static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**newInstance**
([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> componentType, int length)

Creates a new array with the specified component type and
length.
Invoking this method is equivalent to creating an array
as follows:
>
> ```
>  int[] x = {length};
>  Array.newInstance(componentType, x);
>  
> ```

The number of dimensions of the new array must not
exceed 255.

##### Parameters

| componentType | the `Class` object representing the component type of the new array |
| length | the length of the new array |
|---|---|

##### Returns

- the new array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if the specified `componentType` parameter is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if componentType is `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Void.html#TYPE` or if the number of dimensions of the requested array instance exceed 255. |
| [NegativeArraySizeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NegativeArraySizeException.html) | if the specified `length` is negative |
|---|---|

#### public static [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**newInstance**
([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> componentType, int... dimensions)

Creates a new array
with the specified component type and dimensions.
If `componentType`
represents a non-array class or interface, the new array
has `dimensions.length` dimensions and
`componentType` as its component type. If
`componentType` represents an array class, the
number of dimensions of the new array is equal to the sum
of `dimensions.length` and the number of
dimensions of `componentType`. In this case, the
component type of the new array is the component type of
`componentType`.

The number of dimensions of the new array must not
exceed 255.

##### Parameters

| componentType | the `Class` object representing the component type of the new array |
| dimensions | an array of `int` representing the dimensions of the new array |
|---|---|

##### Returns

- the new array

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if the specified `componentType` argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the specified `dimensions` argument is a zero-dimensional array, if componentType is `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Void.html#TYPE`, or if the number of dimensions of the requested array instance exceed 255. |
| [NegativeArraySizeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NegativeArraySizeException.html) | if any of the components in the specified `dimensions` argument is negative. |
|---|---|

#### public static void
**set**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) value)

Sets the value of the indexed component of the specified array
object to the specified new value. The new value is first
automatically unwrapped if the array has a primitive component
type.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the array component type is primitive and an unwrapping conversion fails |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

#### public static void
**setBoolean**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, boolean value)

Sets the value of the indexed component of the specified array
object to the specified `boolean` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setByte**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, byte value)

Sets the value of the indexed component of the specified array
object to the specified `byte` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setChar**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, char value)

Sets the value of the indexed component of the specified array
object to the specified `char` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setDouble**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, double value)

Sets the value of the indexed component of the specified array
object to the specified `double` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setFloat**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, float value)

Sets the value of the indexed component of the specified array
object to the specified `float` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setInt**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, int value)

Sets the value of the indexed component of the specified array
object to the specified `int` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setLong**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, long value)

Sets the value of the indexed component of the specified array
object to the specified `long` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`

#### public static void
**setShort**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) array, int index, short value)

Sets the value of the indexed component of the specified array
object to the specified `short` value.

##### Parameters

| array | the array |
| index | the index into the array |
| value | the new value of the indexed component |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the specified object argument is null |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | If the specified object argument is not an array, or if the specified value cannot be converted to the underlying array's component type by an identity or a primitive widening conversion |
| [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | If the specified `index` argument is negative, or if it is greater than or equal to the length of the specified array |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/Array.html#set(java.lang.Object,%20int,%20java.lang.Object)`