Java Character highSurrogate() 方法

2024 年 11 月 6 日 | 阅读 2 分钟

Character 类的 highSurrogate(int codePoint) 方法通常返回给定代理对的当前代理 codePoint,该代理对表示 UTF 编码中的补充字符。如果给定的字符未指定(或无效),则返回一个未指定的 char。

语法

参数

codePoint:需要测试的补充字符。

返回值

Character 类的 highSurrogate(int codePoint) 方法返回当前代理码单元,该码单元用于指示 UTF-16 编码中的字符。

示例 1

输出

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

示例 2

输出

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:
?