Javatpoint Logo
Javatpoint Logo

Java Character lowSurrogate() Method

The lowSurrogate(int codePoint) method of Character class returns the trailing surrogate code unit which is used for the representation of the character in the UTF-16 encoding. On the other hand, if the specified character is not a supplementary character, an unspecified char is returned.

If the method isSupplementaryCodePoint (x) is true, the method isLowSurrogate(lowSurrogate(x)) and the method toCodePoint(highSurrogate(x), lowSurrogate(x))==x are also true.

Syntax

Parameter

The above method requires only one parameter:

a.) The codePoint which is the character that needs to be tested.

Return Value

The lowSurrogate(int codePoint) method returns the trailing code unit which is used as the representation of the character in the UTF-16 encoding.

Example 1

Test it Now

Output:

The current surrogate code unit for the character65 is:?
The current surrogate code unit for the character152 is:?
The current surrogate code unit for the character567 is:?

Example 2

Test it Now

Output:

The codePoint '49' is a current surrogate code unit.
The codePoint '121' is a current surrogate code unit.
The codePoint '2342' is a current surrogate code unit.
Next TopicJava Character




Please Share

facebook twitter google plus pinterest