why java has the size of character 2 byte ,while in c/c++ it
is of 1 byte?

Answer Posted / kunal modi

Because c/c++ is based on the ASCII
And there is only 0 to 255 characters
And 1 byte is enough for represent
256 characters (2*power8=256)
Because c/c++ only support american
Characters
But in java its used the unicode because
It carry all character exist in world
And only 3100-3200 characters present in
World and 1 byte can only store 256
Characters that's why in java char take
2 byte and it can carry (2*power16=65536)
Characters

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are streams faster than for loops?

494


What is stateless class in java?

500


What if I do not provide the string array as the argument to the method?

495


Where is java installed?

465


Why java?

529






What is a pojo class in java?

488


What is java flatmap?

481


What is the use of jprofiler?

474


In an htm form i have a button which makes us to open another page in 15sec.how will you do that?

1356


What is scrollable resultset in java?

471


When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?

494


What is aop in java?

490


What is interceptor in java?

462


Explain the encapsulation principle.

531


What is mime in java?

495