Java: Range of a char
A char
typically represents an UTF-16 encoded Unicode Character, but it can also be treated as an unsigned 16-bit integer.
Min value (inclusive) and max value (inclusive):
\u0000
… \uFFFF
or, alternatively
0 … 65,535
These values are available as constants: Character.MIN_VALUE
and Character.MAX_VALUE
.
Note: There are more than 65,536 unicode symbols. Some symbols therefore require 2 chars. This means, for instance, that a String
of length 1 may consist of 2 chars!
See ranges of all primitive types here: Java: Ranges of Primitive Types.