educative.io

Educative

Can a derived class can change the definition of an inherited member in php?

In the quiz section of the “Classes and Inheritance” module, there’s a quiz question asking whether a derived class can change the definition of an inherited member.
The answer given to this question is no.
But isn’t it wrong? A derived class can override and hence change the definition of an inherited member.

Hi @Nikki ,

Yes. A derived class can change the definition of an inherited member. The correct option “True” is updated in the quiz section.

1 Like