0Pricing
Kotlin Academy · Lesson

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 = 0b00001111

All lessons in this course

  1. Setting Up Kotlin: REPL, IntelliJ & Online Playground
  2. val vs var: Immutability From Day One
  3. Kotlin Basic Types: Int, Double, Boolean, Char
  4. Your First Kotlin Program: main, println & Input
← Back to Kotlin Academy