What is the numerical range of a char?

1 votes
173 views
Chirag agarwal asked 20-Nov-2017 in Technology by Chirag agarwal

What is the numerical range of a char?

1 Answer

0 votes
akriti kashyap answered 21-Nov-2017 by akriti kashyap

What is the numerical range of a char?

As per the Unicode Character Base Scheme, a ‘char’ datatype in JAVA yields a space of 2 Bytes in a memory location.


Hence, the calculation:

2*8 = 16 bits
So,
(2^16)-1 = 65535

Thus, shows JAVA character have Unsigned Integer Value.
Fruitful information for programmers for yielding an efficient code
All The Best!


UTKARSHASINGHROUL commented 04-Apr-2019 by UTKARSHASINGHROUL
Thanks for answering.
       0