Espresso

Report a typo

Select the correct output of the code below:

open class Drink(val cost: Int) {
    override fun toString() = "cost=$cost, name=Drink"
}

class Coffee(cost: Int, val name: String): Drink(cost) {
    override fun toString() = "cost=$cost, name=$name"
}

println(Coffee(10, "Espresso"))
Select one option from the list
___

Create a free account to access the full topic