Comprehension of inheritance

Report a typo

Choose the correct cases of inheritance:

1) open class Product(price: Int, name: String)
   
   class Milk(price: Int, name: String) : Product(price, name)
2) open class Product(price: Int, name: String)

   class Kombucha(price: Int, volume: Int, name: String) : Product(price, name)
3) open class Product(price: Int, name: String)

   class Juice(price: Int, name: String) : Product(price)
4) open class Product(price: Int, name: String)

   class Water() : Product(price, name)
Select one or more options from the list
___

Create a free account to access the full topic