Java Array setChar() Method

The setChar() method of Array class is used to set the value of the indexed component of the specified array object to the specified char value.

Syntax

Parameter

array - the array

index - the index into the array

c - the new value of the indexed component

Returns

Does not return any value.

Throws

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException -

NegativeArraySizeException

Example 1

Test it Now

Output:

Value :: A

Example 2

Test it Now

Output:

JAVA




Latest Courses