This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is the numerical range of a char? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is the numerical range of a char?" Watch "What is the numerical range of a char?" New topic
Author

What is the numerical range of a char?

Maxwell Wood
Ranch Hand

Joined: Feb 15, 2011
Posts: 49
i know this is a silly question but i just wanna make sure
is it -32768 . . . 32767???
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3899
    
  18

No. It's 0..65535. Chars are unsigned.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14917
    
  26

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Maxwell Wood
Ranch Hand

Joined: Feb 15, 2011
Posts: 49
thank you guys
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the numerical range of a char?
 
jQuery in Action, 3rd edition