One plus plus two compiles unexpectedly [duplicate]
问题 This question already has answers here : Why does this Java code with “+ +” compile? (8 answers) Closed 5 years ago . So, I expect this not to compile, and it doesn't: // the two is inc'd, so reduces symbolically to println(int int) // which is a compile error System.out.println(1 ++ 2); But this does: System.out.println(1 + + 2); // returns three What gives? Shouldn't it also not compile? Also, this question is very hard to search for because of the operators.. 回答1: Java is interpreting the