Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the numerical range of a char?  RSS feed

 
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
Saloon Keeper
Posts: 7006
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. It's 0..65535. Chars are unsigned.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15865
81
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!