Tsallaka zuwa abun ciki
Justice Tech School

Kotlin Constants

const val declares a compile time constant at top level or in an object. It must be a primitive or String.

Example
const val MAX = 100
const val APP = "JTS"
fun main() { println("$APP $MAX") }

Exercise

Declare a compile time constant.

 val MAX = 1

Quiz Test

Which must be known at compile time?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.