Java Array.getInt(Object array, int index)

Syntax

Array.getInt(Object array, int index) has the following syntax.

public static int getInt(Object array,  int index)   
            throws IllegalArgumentException ,    
                   ArrayIndexOutOfBoundsException

Example

In the following code shows how to use Array.getInt(Object array, int index) method.


import java.lang.reflect.Array;
// ww w  .  j  a  v  a2 s.c om
public class Main {
  public static void main (String args[]) {
    int[] array = new int[]{1,2,3};
    
   
    int value = Array.getInt(array, 1);

    System.out.println(value);

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable