Kotlin - Data Types
Identify the error in this Kotlin code snippet:
fun main() {
val a: Int = null
println(a)
}fun main() {
val a: Int = null
println(a)
}Int is non-nullable by default and cannot hold null.null to a causes a compilation error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions