Kotlin - Variables and Type System
What will be the output of the following Kotlin code?
const val PI = 3.14
fun main() {
println("Value of PI: $PI")
}const val PI = 3.14
fun main() {
println("Value of PI: $PI")
}println statement uses $PI which means it will replace $PI with the value of the constant PI.PI is declared as 3.14, so the output will be "Value of PI: 3.14" exactly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions