Explore Library
KotlinIntroduction & Core Concepts

50 items

Code QuizBeginner

Assigning null

See why a non-nullable type cannot hold null.

Codekotlin
fun main() {
    var name: String = null
    println(name)
}

What is the bug in this code?