This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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: 3401
    
    9
No. It's 0..65535. Chars are unsigned.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

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 7 API documentation
Scala Notes - My blog about Scala
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?
 
Similar Threads
Posting to bump up my count...
The x900 effect ?
media player applet
Text box value is not being completely filled with request attribute
WA #1.....word association