简体   繁体   English

Java中Character(char)的大小是多少?

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

What's the size of Character(char) variable in Java? Java中Character(char)变量的大小是多少? if it is based on Unicode, what 's the unicode format it is use, UTF-8, or UTF-16? 如果它基于Unicode,则使用的是Unicode格式,是UTF-8还是UTF-16?

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

Read this : 阅读此

char: The char data type is a single 16-bit Unicode character. char:char数据类型是单个16位Unicode字符。 It has a minimum value of '\' (or 0) and a maximum value of '\￿' (or 65,535 inclusive). 它的最小值为'\\ u0000'(或0),最大值为'\\ uffff'(或65,535(含))。

PS Is this question worth asking? PS这个问题值得问吗? Just 5 seconds of google'ing... google'ing仅5秒...

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

Character.MIN_VALUE is 0 and Character.MAX_VALUE is 65535. Character.MIN_VALUE为0,Character.MAX_VALUE为65535。

Strings are UTF-16 encoded and can give you 16-bit unsigned char or code points of type int . 字符串是UTF-16编码的,可以为您提供16位无符号charint类型的代码点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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