Override member field in derived classes

The new b added in the derived class doesn’t override base’s b. It just hides it.

So, in the derived class you have two b and the virtual method prints corresponding b.

Leave a Comment