My simple question is why:
System.out.println(010|4);
prints \"12\"? I understand bitwise OR operator but why \"010\" equals 8? It\'s defin
That is because java takes it as an octal literal and hence produces 12. Try System.out.println(10|4) and the result is 14. Because this time it is taken as decimal literal.
System.out.println(10|4)