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
How can I swap two variables without using a third variable?
What is java ioc?
I run a web server. Am I at risk? : java security
Java prints out a ton of digits when I system.out.println() a double. How can I format it so it displays only 3 digits after the decimal place?
there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.
I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance
In java thread programming, which method is a must implementation for all threads?
Explain main thread under thread class execution?
How can I protect myself? : java security
Can we write lambda without functional interface?
What is dao in java?
What do you understand by numeric promotion?
How do you create a jar file?
Why java?
How does jpa repository work?