How does a leading zero change a numeric literal in Java?

077 is an octal number which equals 7 x 81 + 7 x 80 which is 63 decimal. To display the octal value you could do

System.out.printf("%o", 077);

Leave a Comment