Why this behavior happens?
long value = 123450;
System.out.println(\"value: \" + value);
value: 123450
long
That's the way java represent an octal literal. Take a look at this:
http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
If what you want is to print something with zeros in the left you need to use DecimalFormat format method.
http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html
In that case you do this:
long value = 123450;
DecimalFormat df = new DecimalFormat("0");
System.out.println("value: " + df.format(value));