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