Assigning a new value replaces the old one — it does not keep both. And score = score + 5 means: take the current value, add 5, and store the result back.
score = score + 5
int score = 10; System.out.println(score); // 10 score = 25; System.out.println(score); // 25 score = score + 5; System.out.println(score); // 30
▶ Try it: run this, then change something and run it again.
What does this print?
int n = 4; n = 9; System.out.println(n);
int a = 3; int b = 5; a = b; b = a; System.out.println(a + " " + b);
Type exactly what this prints:
int x = 5; x = x + 3; System.out.println(x);
Arrange the lines so the program prints 10.
10
True or false?