Clarification about "int" number that begins with 0

java

Solution

If a number starts with 0 it's an octal number with base 8. 012 is in decimal a 10

Problem

``` public class Test { public static void main(String[] args) { int i = 012; System.out.println(i); } } ``` Why the output is : `10`?

Original source

Related problems