In Java, why can't I write i++++ or (i++)++?
问题 When I try to write a postfix/prefix in/decrement, followed by a post/prefix in/decrement, I get the following error: Invalid argument to operation ++/-- . But, according to JLS: PostIncrementExpression: PostfixExpression ++ and PostfixExpression: Primary ExpressionName PostIncrementExpression PostDecrementExpression so writing: PostfixExpression ++ ++ should be possible... Any thoughts? 回答1: Note that the raw grammar lacks any semantics. It's just syntax, and not every syntactically valid