I was reading about Has-a and Is-a relation in here: What do “has-a” and “is-a” mean? [duplicate] . What I understand is that my data members of the class follow the Has-a relation. Let's say that I inherit data members from the Base class. Are they still going to follow Has-a relation? in this example: Car is-a vehicle. Is it still going to have a steering wheel?
class SteeringWheel
{};
class Vehicle
{
public:
SteeringWheel sWheel;
virtual void doStuff() = 0;
};
class Car: public Vehicle
{
virtual void doStuff();
};