Basic Java Language: Difference between revisions
wikademia>Crossbow9 |
|||
| Line 95: | Line 95: | ||
If you want to you want to use the addition operator to add 6 to the value of ''a'', it would be used like this: | If you want to you want to use the addition operator to add 6 to the value of ''a'', it would be used like this: | ||
<pre>a = a + 6;</pre> | <pre>a = a + 6;</pre> | ||
Or you can use a shortcut in order to reach the same result as the above. | |||
<pre>a += 6</pre> | |||
There are shortcuts to all of the operators, which will be shown in the following sections. | |||
===Subtraction -, Division / and Multiplication * Operators=== | ===Subtraction -, Division / and Multiplication * Operators=== | ||