Online Java Compiler By
JavaTpoint.com
//import statement import java.lang.reflect.Array; public class ReflectArraysetDoubleExample1 { public static void main(String[] args) { double arr[] = new double[3]; Array.setDouble(arr , 0 , 2.4); Array.setDouble(arr , 1 , 7.4); Array.setDouble(arr , 2 , 9.4); for (int i = 0; i < arr.length; i++) { double vl = Array.getDouble(arr, i); System.out.print(vl + " , "); } } }
Output