wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes confusing output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "confusing output" Watch "confusing output" New topic
Author

confusing output

kevinn lee
Ranch Hand

Joined: Feb 15, 2010
Posts: 87

why the output is not 100?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Because the leading 0 means the number is octal. Likewise, a number starting with 0x or 0X means the number is hexadecimal.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
kevinn lee
Ranch Hand

Joined: Feb 15, 2010
Posts: 87
Rob Prime wrote:Because the leading 0 means the number is octal. Likewise, a number starting with 0x or 0X means the number is hexadecimal.

thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: confusing output
 
Similar Threads
Why my program works fine when i write Thread.sleep(0)
Getting error while serializing. Please see the following code while produces IOException.
Value of int i=012;
What causes InterruptedException? How to recover?
Example in sample chapter