Complete Kotlin Tutorial: Part 4 (Understanding Data Types)

Ajit Kumar Sahoo
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 valuesByte
  • Short valuesShort
  • IntegersInt
  • Large IntegersLong
  • FractionsFloat
  • Large FractionsDouble
  • CharactersChar
  • Boolean valuesBoolean
  • String valuesString

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-

--

--