Im having trouble understanding class relationships after being asked to research it further, would anyone be able to help?
If I were to create ‘Class A’, and Class A has all the attributes and methods we need for a new class C, but class C requires at least 3 new methods and 3 new attributes, is it possible to form a relationship between Class A and C, and if so, what kind of relationship would that be?
You can think of class inheritance like the following.
You have a Class Automobile. It has a motor, a frame, a fuel tank, wheels.
From there you can inherit/extend Automobile class to create a Racing Car.
Racing Car has a motor, a frame, fuel tank, wheels, but it also has air conditioning and a radio.
Another example would be a bulldozer, it has a motor, a frame, a fuel tank, wheels, no air conditioning but it has a Shovel in front of it etc…