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