Complete Kotlin Tutorial: Part 4 (Understanding Data Types)
6 min readMay 21, 2022
If you are new to this series, start from here
The previous post, Part 3 is here
Now, let’s continue with our journey by understanding every data type available in Kotlin.
We did learn a bit about the data types available in Kotlin in my previous post. Following are the available data types and their explicit declaration in Kotlin-
- Byte values → Byte
- Short values → Short
- Integers → Int
- Large Integers→ Long
- Fractions → Float
- Large Fractions → Double
- Characters → Char
- Boolean values→ Boolean
- String values → String
These data types take different memory spaces in our system. It’s very important to use them wisely in our code. Below are the memory taken by the variables of these data types:-
In case, you need to get range of data types, just do this-