Kotlin Basic Types: Int, Double, Boolean, Char
Learn the primitive-equivalent types in Kotlin and how type inference works.
Kotlin's Type System
In Kotlin, everything is an object — there are no primitive types in the language spec. But the compiler uses JVM primitives under the hood for performance.
Integer Types
Kotlin provides Byte (8-bit), Short (16-bit), Int (32-bit), and Long (64-bit). Int is the default for integer literals.
val age: Int = 25
val population: Long = 8_000_000_000L
val score: Short = 100
val flags: Byte = 0b00001111All lessons in this course
- Setting Up Kotlin: REPL, IntelliJ & Online Playground
- val vs var: Immutability From Day One
- Kotlin Basic Types: Int, Double, Boolean, Char
- Your First Kotlin Program: main, println & Input