regarding leading zero in integer value

Leading 0 signifies an octal number (base 8).

01111 (octal) is 1*8^3+1*8^2+1*8^1+1*8^0=585 (decimal)

Integer.toOctalString(1111) converts the decimal number 1111 to an octal String. 2127 octal (2*8^3+1*8^2+2*8^1+7*8^0) is 1111 decimal.

Leave a Comment