int a[] = {120, 50, 016};
for(int P : a)
System.out.print(P+" ");
I expect the output of above code is 120 50 16, but the actual output is 120 50 14.
int a[] = {120, 50, 016};
for(int P : a)
System.out.print(P+" ");
I expect the output of above code is 120 50 16, but the actual output is 120 50 14.
It is octal base 8 because you have a 0 in front.
See the following link: https://en.wikipedia.org/wiki/Octal