One plus plus two compiles unexpectedly [duplicate] December 29, 2023 by Tarik Java is interpreting the working 1 + + 2 as 1 plus positive 2. See the Unary operator section.