Number of cups

Report a typo

There is an amount parameter in the class Cups, which shows the number of cups. Override toString() so that when you print an object of the Cups class, the number of cups is printed.

Write a program in Kotlin
class Cups(val amount: Int) {
override fun toString(): String {
return (...)
}
}
___

Create a free account to access the full topic