In Java, is a++ a postfix operator or an unary operator?
问题 In Java, is a++ a postfix operator or an unary operator? In the Operator Precedence from Oracle, it is separated. Reference 回答1: It’s both. It’s a unary operator because it works solely on one term. If it’s x++ then it’s a postfix operator as it’s incremented after using the variable’s value. A prefix unary operator is ++x where it’s incremented before being used. Prefix operators have a higher precedence, but they’re both unary operators 来源: https://stackoverflow.com/questions/60014618/in