An object of a base class can’t be referred to using a reference variable of its derived class

I was reading Object Oriented Programming’s concepts from an OCA book. Here in Inheritance Chapter I saw this line written,

An object of a base class can’t be referred to using a reference variable of its
derived class.

But I am not able to get the meaning of it.


Source: oop

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.