Online Java Compiler By
JavaTpoint.com
//import statement import java.lang.reflect.Array; public class ReflectArraysetCharExample1 { public static void main (String args[]) { char[] arr = new char[4]; Array.setChar(arr,0,'J'); Array.setChar(arr,1,'A'); Array.setChar(arr,2,'V'); Array.setChar(arr,3,'A'); char vlu = Array.getChar(arr, 1); System.out.println("Value :: " +vlu); } }
Output