Java Array.getChar(Object array, int index)

Syntax

Array.getChar(Object array, int index) has the following syntax.

public static char getChar(Object array,  int index)   throws IllegalArgumentException ,    ArrayIndexOutOfBoundsException

Example

In the following code shows how to use Array.getChar(Object array, int index) method.


/*from  www.  j  av a2s .  c  om*/
import java.lang.reflect.Array;

public class Main {
  public static void main (String args[]) {
    char[] array = new char[]{'a','b','c'};
    
   
    char value = Array.getChar(array, 1);

    System.out.println(value);

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable