Java Reflection - Java Array.getDouble(Object array, int index)








Syntax

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

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

Example

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

import java.lang.reflect.Array;
//from   w  w w .  jav a 2  s.  c  o m
public class Main {
  public static void main (String args[]) {
    double[] array = new double[]{1.1,2.2,3.3};
    
   
    double value = Array.getDouble(array, 1);

    System.out.println(value);

  }
}

The code above generates the following result.