Array.Set(Object, Int32, Object) Method

Definition

Sets the value of the indexed component of the specified array object to the specified new value.

[Android.Runtime.Register("set", "(Ljava/lang/Object;ILjava/lang/Object;)V", "")]
public static void Set (Java.Lang.Object array, int index, Java.Lang.Object? value);
[<Android.Runtime.Register("set", "(Ljava/lang/Object;ILjava/lang/Object;)V", "")>]
static member Set : Java.Lang.Object * int * Java.Lang.Object -> unit

Parameters

array
Object

the array

index
Int32

the index into the array

value
Object

the new value of the indexed component

Attributes

Exceptions

if array == null

if array is not an array or the value cannot be converted to the array type by a widening conversion

if index = array.length

Remarks

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.

Java documentation for java.lang.reflect.Array.set(java.lang.Object, int, java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to