Online Java Compiler By
JavaTpoint.com
//import statement import java.lang.reflect.Array; public class ReflectArraysetLongExample1 { public static void main(String[] args) { long arr[] = new long[3]; Array.setLong(arr , 0 , 276657); Array.setLong(arr , 1 , 76576576); Array.setLong(arr , 2 , 9768768); for (int i = 0; i < arr.length; i++) { Long vl = Array.getLong(arr, i); System.out.print(vl + " , "); } } }
Output