Learn
Using Number Variables
Review
Excellent work! You’ve completed the final lesson on variables and learned the fundamentals of numbers in Kotlin. Let’s review what was covered.
- The
Number
superclass containsInt
,Long
,Short
,Byte
,Float
andDouble
data types. - The arithmetic operators supported by Kotlin include
+
,-
,*
,/
and%
. - Augmented assignment operators include an arithmetic and assignment operator used to calculate and reassign a value in one step.
- The increment operator includes two consecutive plus operators,
++
, used to add 1 to a value and reassign the result. - The decrement operator includes two consecutive minus operators,
--
, used to subtract one from a value and reassign the result. - The order of operations includes parentheses, multiplication, division, modulus, addition and subtraction.
- The
Math
library is inherited from Java and contains various mathematical functions for use in a Kotlin program.
Feel free to utilize the empty Review.kt file and output terminal on the right to hone your understanding of numbers and practice writing Kotlin code.
Instructions
Click Up Next when you’ve completed the review.