This week's book giveaway is in the Performance forum. We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line! See this thread for details.
I read about the rules for unary and binary numeric promotion. Unary numeric promotion is valid for operators:+,-,~,,<<,>>>,>> Binary numeric promotion is valid for: -relational operators -bitwise operators - == and != -arithmetic operators Does the type promotion occur for ++ and - - operators?What type?Unary or Binary?
posted 10 years ago
Yes, it happens. Promotion and autocasting.
This is equal to:
The ++ and -- operators act on a single operand, therefore the answer to your questions regarding if this is a binary or unary numeric promotion is evident.