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

Where are group policies stored? : java security

633


Explain issues of old java date api?

759


How do I install eclipse?

681


What is exe file in java?

688


Write a class which checks whether a given number is prime or not. Write another class to implement the behavior of previous class and print the series of twin prime number upto a given range.

1544


What is a driver in java?

716


What are struts java?

669


How long can a lambda function run?

687


What is java lang exceptionininitializererror?

649


What about products that claim to detect malicious applets? : java security

640


What is a stream in java?

699


Is eclipse a jdk?

668


What is dependency injection in java?

660


Topic- looping,function overloading,nesting ,polymorphism. Aim - to write a function with a name buzz-buds,that will check whether the given numbers are buddies or not on the basis of no. of parameters passed during function calling.

1820


How do javabeans work?

638