This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one 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


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: 3696
    
  17

No. It's 0..65535. Chars are unsigned.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14706
    
  25

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?