What's the size of Character(char) variable in Java? if it is based on Unicode, what 's the unicode format it is use, UTF-8, or UTF-16?
4 Answers
The char data type is a single 16-bit Unicode character according to The Java Tutorials.
1 Comment
Basilevs
Confidently wrong :)
char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).
P.S. Is this question worth asking? Just 5 seconds of google'ing...
1 Comment
AHungerArtist
My guess is that it seems the OP asking about the size of Character, not char (though it's not really clear). Though I believe those should be the same.