Description

The charValue() java method determines returns the value of this Character object. Basically this method is just a way to convert the Character object into it’s primitive data type char.

Method Syntax

public char charValue()

Method Argument

Data Type Parameter Description
N/A N/A N/A

Method Returns

The charValue() method of Character class returns the primitive char value represented by this object.

Compatibility

Requires Java 1.0 and up

Java Character charValue() Example

Below is a simple java example on the usage of charValue() method of Character class.

Sample Output

Below is the sample output when you run the above example.

java Character charValue() example output