Array.setInt(Object array, int index, int i) has the following syntax.
public static void setInt(Object array, int index, int i) throws IllegalArgumentException , ArrayIndexOutOfBoundsException
In the following code shows how to use Array.setInt(Object array, int index, int i) method.
import java.lang.reflect.Array; import java.util.Arrays; /*from www . j av a 2 s.c o m*/ public class Main { public static void main (String args[]) { int[] array = new int[]{1,2,3}; Array.setInt(array, 1, 100); System.out.println(Arrays.toString(array)); } }
The code above generates the following result.