Why character in Java is of two byte and in C it is of one byte?


Characters in C are ASCII characters.  and There are only 256 different characters in the ASCII character set, and so 8-bits are enough to store this data.

Characters in Java are 16-bit Unicode characters (65536 different characters), so twise as much storage is needed to store the extra characters.

0 comments :

Post a Comment