There are ways to make modifying integers and other number variables much more quick then they usually are. Want to know how? Read on...
I'll teach you speedy number operations in this tip. Please note: varName
represents a variable, so I don't have to explain that to you over and over.
varName can be changed with any variable. Now, let's
get on with it...
Don't you hate having to write out stuff like:varName = varName + 1
Well there is an easier way!! You can simply use:varName ++
This will add 1 to your number. ++
simply adds 1. What if you wanted
to add another number, like 5? Well, there's a good way to do this too. Just
use:varName =+ 5
=+
tells JAVA that you're adding to your integer. Just put a number
after it and it will be added! Simple! I hope this has been helpful.
Comments