Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

The result for the above charactetr is given as:65808

Example 2

Test it Now

Output:

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




Please Share

facebook twitter google plus pinterest