What is the range of the char type

The range of the char type is 0 to 2^16 - 1.

Showing Answers 1 - 3 of 3 Answers

Sumit Sengar

  • Aug 24th, 2005

char is unsigned so its minimum value is 0. It can't be negative.

  Was this answer useful?  Yes

In java, the range of a char type is
0 to 65535
0 to +((2^16)-1)
Getting java to print out the MIN_VALUE and max value is tricky because the characters at position 0 and 65535 are unprintable.  To remedy this cast the Character to an int.

  Was this answer useful?  Yes


  • Apr 14th, 2015

according to me size of char type is 2^15-1..

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions