Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / somebdy

because java support UNICODE charactres which have large
range .. than ASCII ..
thats y it needs 16 bits .

Is This Answer Correct ?    24 Yes 3 No

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

Answer / 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

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

Answer / chandan singh

It is because C and C++ has limited set of characters. But java has all the character which are used in the whole world. like chineese language itself has 126 character. Every character has unique code and it is defined by Unicode system. Similarly java supports many many other characters but C and C++ don't.

Is This Answer Correct ?    7 Yes 3 No

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

Answer / ritu joon

When java developer develop java language then they desiged it like that primitive data type character take 2 byte when it converted into Unicode..and c++ developer doesn't designed like that....

Is This Answer Correct ?    2 Yes 2 No

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

Answer / chandan

Java was created around the time when the Unicode standard had values defined for a much smaller set of characters. Back then it was felt that 16-bits would be more than enough to encode all the characters that would ever be needed. With that in mind Java was designed to use UTF-16. In fact, the char data type was originally used to be able to represent a 16-bit Unicode code point.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / eknath337

Bcz of the JVM internally representing the character in
Hexadecimal system.That's why it is using 2 byte instead of
1 byte.

Is This Answer Correct ?    3 Yes 4 No

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

Answer / wasim

because java can handle any other country character

Is This Answer Correct ?    1 Yes 3 No

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

Answer / venkat

by Ascii code system

Is This Answer Correct ?    5 Yes 13 No

Post New Answer

More Java Related AllOther Interview Questions

Can a method be static and synchronized?

0 Answers  


What is stateful in java?

0 Answers  


1.can i use super keyword in normal class(not inheritance) to call any method?if so how can i call particular variable? 2.In the inheritance how can i access the particular variable from the base class(it containing 5 variables) using super keyword?

0 Answers  


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.

0 Answers   Sapient,


What is meant by swing in java?

0 Answers  


What is a controller in java?

0 Answers  


What is java api?

0 Answers  


What is default constructor in java?

0 Answers  


what is the package for freshers in valuelabs.

0 Answers  


What does @override mean in java?

0 Answers  


Is java Class Thread safe ???? How to make java Class Thread safe ??

1 Answers   Cognizant, TCS,


What do you understand by numeric promotion?

0 Answers  


Categories