This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Range of integer types 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 "Range of integer types" Watch "Range of integer types" New topic

Range of integer types

Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
Do we need to know all the exact ranges of byte, short, int, long, float, double and char for the exam?

Rob Petterson
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
I think you can manage by...
knowing the exact range in decimal for byte, short, char and int.
long in exponential form: - 2to63 to 2to63 -1
for float and double only a general sense of the range:
float 3.4e+38 to 1.4e-45
double 1.8e+308 to 4.9e-324

SCJP2. Please Indent your code using UBB Code
Jamal Hasanov
Ranch Hand

Joined: Jan 08, 2002
Posts: 411
Yes Rob, you also need to know the size of them,
byte - 8 bit
char - 16 bit
short - 16 bit
int - 32 bit
long - 64 bit
float - 32 bit
double - 64 bit
Jamal Hasanov
Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
thanks guys.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Range of integer types
jQuery in Action, 3rd edition