When you write an integer literal starting with a 0 in
Java, such as 010 in the code above, then the number is interpreted as an
octal number (base 8) instead of a normal, decimal number (base 10).
010 in octal = 8 in decimal (read about octal if you don't understand why).
The | operator is the bitwise OR operator.
So: 010 | 4 = 8 | 4, in binary this is: 1000 | 0100 = 1100, which is 12 in decimal.