Returns the value of the indexed component in the specified array object, as a
double
.
package com.logicbig.example.array;
import java.lang.reflect.Array;
public class GetDoubleExample2 {
public static void main(String... args) {
Double[] arr = {1d, 4d, 9d};
double d = Array.getDouble(arr, 1);
System.out.println(d);
}
}
Output
Caused by: java.lang.IllegalArgumentException: Argument is not an array of primitive type
at java.base/java.lang.reflect.Array.getDouble(Native Method)
at com.logicbig.example.array.GetDoubleExample2.main(GetDoubleExample2.java:14)
... 6 more