Ritesh raushan wrote:char takes one byte for each character...
Says who? You've plainly discovered that in Java, it doesn't.
Isn't it funny how there's always time and money enough to do it WRONG?
Stephan van Hulst
Joined: Sep 20, 2010
If a character was only one byte, you could have no more than 256 characters. The latin alphabet alone uses 24 letters and 10 digits. What about all the other languages with their alphabets and special letters and symbols? There is no way you can represent them all with only one byte.
With two bytes, you can represent 65.536 characters. This seems much more adequate.