Why is the size of char 1 byte in C language and 2 bytes in Java?

201 views.

When an application is developed in C language, it uses the characters of only English language. To store the English language character 1 byte of memory is sufficient. The C language uses ASCII Character set (0-255).

 

When an application is developed in Java language, it uses the character of all the foreign language. To store the character of all languages 1 byte of memory is not sufficient, there fore the size is increased to 2 bytes in java language. The Java language uses UNICODE Character set (0-65535)

 

Leave a Reply