Integer Data Type -
| Data Type | Space Required |
|---|---|
| byte | 8 bits |
| short | 16 bits |
| int | 32 bits |
| long | 64 bits |
Floating Point Data Type -
| Data Type | Space Required |
|---|---|
| float | 32 bits |
| double | 64 bits |
Boolean Data Type -
True or false is the only bit of information represented by the Boolean data type. In Kotlin, the Boolean type is the same as in Java.
| Data Type | Space Required |
|---|---|
| boolean | 1 bit |
Character Data Type -
Small letters (a-z), capital letters (A-Z), numerals (0-9), and other symbols are represented by the character data type.
| Data Type | Space Required |
|---|---|
| char | 8 bits |
String Data Type -
Strings are represented in Kotlin by the type String. A string value is often a sequence of characters enclosed in double quotations ("). The space required in this case depends on the number of characters in the string.
Array Data Type -
The Array class in Kotlin is used to represent arrays. It has the get and set functions that, due to operator overloading conventions, can be used as ‘[]’ as well. The space required by the array also depends on the number of elements it posses.