Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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: 3983
    
  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: 14950
    
  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
 
Have you checked out Aspose?
 
subject: What is the numerical range of a char?
 
It's not a secret anymore!