Algus

Compile-Time Constants

There are special cases where a val can return different values (more on that later). When we are sure that a piece of data won’t be changed, we should use a compile-time constant.

💡 A const declaration gives the compiler the flexibility to perform optimization behind the scenes.

const val THE_ANSWER = 42

fun main(){
	println(theAnswer)
}