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