Quiz: Inheritance

Test your understanding of the concepts discussed in this chapter.

1

Which statement is false about the following code?

open class Animal {
   val name: String
}

class Dog(name: String) : Animal(name)
A)

Class Dog is a subclass of class Animal.

B)

Class Dog has a property name.

C)

Class Animal can be inherited by other classes.

D)

Class Dog can be inherited by other classes.

Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.