Java Array.setDouble(Object array, int index, double d)

Syntax

Array.setDouble(Object array, int index, double d) has the following syntax.

public static void setDouble(Object array,  int index,  double d)   throws IllegalArgumentException ,    ArrayIndexOutOfBoundsException

Example

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


//  w w  w .  j av a2  s.  c o m
import java.lang.reflect.Array;
import java.util.Arrays;

public class Main {
  public static void main (String args[]) {
    double[] array = new double[]{1,2,3};
    
    Array.setDouble(array, 1, (double)1);
    
    System.out.println(Arrays.toString(array));


  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable