I have searched the web and it gives me a divide answer. Some said it is only an unary operator and some said it is an arithmetic operator. Thanks
These classifications don't contradict each other.
++ is an unary operator, as it applies to a single operand.
++ is also an arithmetic operator, as it applies to a number and performs an arithmetic operation (incrementing the number by one).
I think it won't be a mistake to call i++ both Arithmetic and Unary Operator.
However, Oracle doc here distinguishes and classifies ++ as Unary operator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With