Predict the output for the below code:-

fun main(args:Array<String>){
    val name:String="Infosys"
    name=null
    println(name)
}

Compilation Error - "Val cannot be reassigned"
Prints "Infosys"
Compilation Error - "Null can not be a value of a non-null type String"
Compilation Errors - Val cannot be reassigned" and "Null can not be a value of a non-null type String"
Verified Answer
Correct Option - d

To get all Infosys Certified Kotlin Android Developer Exam questions Join Telegram Group https://rebrand.ly/lex-group-70b557

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 16 Sept 2025