Create a child class

Report a typo

What is the correct way of creating a child class?

  1. class Headphones() : Gadget(price: Int, brand: String)
  2. class Headphones(price: Int, brand: String, type: String) : Gadget(price: Int, brand: String)
  3. class Headphones(price: Int, brand: String, val type: String) : Gadget(price, brand)
  4. class Headphones(price, brand, val type: String) : Gadget(price, brand)

Select one option from the list
___

Create a free account to access the full topic