x += 5 is shorthand for x = x + 5: take the current value, add 5, store it back. The same works for -=, *=, and /=.
x += 5
x = x + 5
-=
*=
/=
int x = 10; x += 5; // x is now 15 x -= 3; // x is now 12 x *= 2; // x is now 24
▶ Try it: run this, then change something and run it again.
What does this print?
int x = 10; x += 5; System.out.println(x);
x += 1 is exactly the same as which line?
x += 1
Type exactly what this prints:
int x = 4; x *= 3; System.out.println(x);
int x = 20; x /= 4; System.out.println(x);
Match each compound assignment to the same thing written out in full.