Java Character toCodePoint() Method

The toCodePoint(char high, char low) method of character class generally converts the specified surrogate pair into its supplementary codePoint value. The above method does not validate the given surrogate pair. The caller must need to validate it by using isSurrogatePair if necessary.

Syntax

Parameter

The above method requires two parameters:

a.)The high surrogate codePoint.

b.)The low surrogate codePoint.

Return Value

The toCodePoint(char high, char low) method returns the supplementary codePoint from the given surrogate pair.

Example 1

Output:

The result for the above charactetr is given as:65808

Example 2

Output:

The result for the above character is given as:324896
The result for the above character is given as:-624864