Javatpoint Logo
Javatpoint Logo

Java Character highSurrogate() Method

The highSurrogate(intcodePoint) method of Character class generally returns the current surrogate codePoint for the given surrogate pair which indicates the supplementary character in the UTF encoding. If the given character is not specified(or valid), an unspecified char is returned.

Syntax

Parameter

codePoint: It is a supplementary character that needs to be tested.

Return Value

The highSurrogate(intcodePoint)method of Character class returns the current surrogate code unit which is used to indicate the character in the UTF-16 encoding.

Example 1

Test it Now

Output:

The leading surrogate for the codePoint 6587 is given as:?
The leading surrogate for the codePoint 67324 is given as:?

Example 2

Test it Now

Output:

The integer value for the character 2 is given as:
?
The integer value for the character { is given as:
?
The integer value for the character * is given as:
?
The integer value for the character @ is given as:
?
The integer value for the character $ is given as:
? 
Next TopicJava Character



Please Share

facebook twitter google plus pinterest