Online Java Compiler By
JavaTpoint.com
//import statements import java.lang.reflect.Array; public class ReflectArraygetFloatExample2 { public static void main(String[] args) { float[] arr = new float[]{1.0f,2.0f,3.0f}; System.out.println("arr[0] = " + Array.getFloat(arr, 0)); System.out.println("arr[1] = " + Array.getFloat(arr, 1)); System.out.println("arr[2] = " + Array.getFloat(arr, 2)); } }
Output