Jonny and his banjo

Report a typo

What does this code return to console?

data class Musician(var name: String, var instrument: String = "Guitar", var band: String = "Radiohead")

fun main() {
    val musician = Musician("Jonny Greenwood").apply {
      instrument = "Banjo" // here we can also use this.instrument
    }
    print(musician)
}
Select one option from the list
___

Create a free account to access the full topic