Page 112 - AP Computer Science A, 7th edition
P. 112

evaluate the second expression containing the division.
Assignment Operators
Operator Example
= x=2
+= x+=4 -= y-=6 āˆ—= pāˆ—=5 /= n/=10 %= n%=10
Meaning
simple assignment x=x+4 y=y–6 p=pāˆ—5 n = n / 10 n = n % 10
         NOTE
1. All these operators, with the exception of simple assignment,
are called compound assignment operators.
2. Chaining of assignment statements is allowed, with
evaluation from right to left.
int next, prev, sum;
next = prev = sum = 0; //initializes sum to 0, then prev to 0
//then next to 0
Increment and Decrement Operators
Operator Example Meaning
i is
++ i++ or ++i incremented
      by 1--















































































   110   111   112   113   114