Hi, I am having difficulty understanding why the values represented in these statements are what they are int b=0xff int i= 0x7FFF When I compile and run i get 255 and 2047. Is there an easy way to understand what and how these numbers represent? There was a great posting a little while ago explaining Octal and Hex numbers, and I am clear on their values. I am scheduled to write the exam a week from today and would like to iron out these bugs in my brain. Thanks for your help. p.s. Should I understand how to do these calculations. I see them occasionally on mock exams.

Here's a simple little rule. 1. ALL integral literals are of type int, regardless of their radix (base notation). Examples: 127 //int literal 456789 //int literal 016 //int literal represented in OCTAL notation 0xFF //int literal represented in HEXADECIMAL notation 0Xffabcd //int literal represented in HEX. Rule #2: 2. All floating point literals are of type double, casts not withstanding (ie, yes you can include an F or f or (float) and then it won't be a double but I'm just talking about a plain undecorated floating-point literal value) examples: 1. //double .1 //double 0.1 //double 123.456 //Can you guess what this is? 789.12 //boolean. NO THAT WAS A JOKE. IT'S ALSO A DOUBLE. Hope this makes it crystal clear

Rob
SCJP 1.4

Don't get me started about those stupid light bulbs.