So far you've learned about: int
、long
、double
、String
and char
.
Now, you can use math operators shown as below to play with these values.
+, -, *, /, %, ++, --, +=, -=, ...
An operation between whole numbers returns a whole number.
An operation between decimals will always perserve the decimal.
It's very useful if you want to identify odd or even numbers.
int remainder = 10 % 2; // 0
See you in workbook 2.3