December Code

December Code / Try Kotlin

Try Kotlin

No account needed. Answer, see why, move on.

1 of 3 today

Scope Functionseasy

What does this Kotlin code print?

class Cfg {
    var host = ""
    var port = 0
}
val c = Cfg().apply {
    host = "db"
    port = 5432
}
println("${c.host}:${c.port}")
Choose one option
choose an option

Nothing here is saved. Create a free account to keep your progress, take an assessment and get your readiness score.