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

Method Returns

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


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