简体   繁体   中英

what is the size of Character(char) in Java?

What's the size of Character(char) variable in Java? if it is based on Unicode, what 's the unicode format it is use, UTF-8, or UTF-16?

根据Java指南 ,char数据类型是单个16位Unicode字符

Read this :

char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\' (or 0) and a maximum value of '\￿' (or 65,535 inclusive).

PS Is this question worth asking? Just 5 seconds of google'ing...

Java char为16位,并包含用于UTF-16编码的Unicode代码点的代码单元。

Character.MIN_VALUE is 0 and Character.MAX_VALUE is 65535.

Strings are UTF-16 encoded and can give you 16-bit unsigned char or code points of type int .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM