Character size in Java vs. C

后端 未结 5 1042
旧时难觅i
旧时难觅i 2021-01-04 04:16

Why does a character in Java take twice as much space to store as a character in C?

5条回答
  •  [愿得一人]
    2021-01-04 05:02

    The Java 2 platform uses the UTF-16 representation in char arrays and in the String and StringBuffer classes.

    • java.lang.Character
    • java.lang.String

提交回复
热议问题