Java Array getChar() Method

20 Mar 2025 | 1 min read

The getChar() method of Array class returns the value of the indexed component in the specified array object, as a char.

Syntax

Parameter

array - the array

index - the index

Returns

The value of the indexed component in the specified array

Throws

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException

Example 1

Output:

 Value :: T 

Example 2

Output:

 array[0] = J array[1] = A array[2] = V array[2] = A