Advertisement
English transcript
Okay, hopefully you've absorbed that pattern into your fingers.
So now you know how to type at updating variables.
We hope this reduces your errors when you're adding this code to
Android Studio.
Here's what the value of the quantity variable is after
each line of code is executed.
It starts off at 2 and then you add 1 to it, so it becomes 3.
Then you add 1 to that again, and it becomes 4.
Then you add 1 again and it becomes 5.
So after all of these lines of code are executed,
the latest value of the quantity variable is 5.
So now you know how to type at updating variables.
We hope this reduces your errors when you're adding this code to
Android Studio.
Here's what the value of the quantity variable is after
each line of code is executed.
It starts off at 2 and then you add 1 to it, so it becomes 3.
Then you add 1 to that again, and it becomes 4.
Then you add 1 again and it becomes 5.
So after all of these lines of code are executed,
the latest value of the quantity variable is 5.