Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the numerical range of a char?

 
Maxwell Wood
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know this is a silly question but i just wanna make sure
is it -32768 . . . 32767???
 
Stephan van Hulst
Bartender
Posts: 6337
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. It's 0..65535. Chars are unsigned.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15492
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find answers to questions like these in the Java Language Specification. The answer to your question can be found in section 4.2.1.
 
Maxwell Wood
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you guys
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic