Why is a char two bytes?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imranhassan27
    New Member
    • Apr 2008
    • 2

    #1

    Why is a char two bytes?

    why character takes two bytes in java
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

    This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

    MODERATOR

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      A char holds a Unicode value, which is two bytes:



      Supplementary characters must be represented either as a surrogate pair within a char sequence, or as an integer, depending on the API they are used with.

      Comment

      Working...