Kotlin Data Types
Understand common Kotlin data types including Int, Double, Boolean, Char and String.
Kotlin Code
Study the example and understand each part.
fun main() {
val age: Int = 20
val price: Double = 1500.50
val active: Boolean = true
val grade: Char = 'A'
val name: String = "Vincent"
println(age)
println(price)
println(active)
println(grade)
println(name)
}
Kotlin is commonly developed using Android Studio or IntelliJ IDEA. These examples can be used as a foundation for Android application development.
Key Concept
Kotlin provides strong type checking while also allowing type inference when the type is obvious from the assigned value.
Expected Output / Result
20 1500.5 true A Vincent
Finished this lesson?
Mark it complete to update your course progress.