When Car dies, so does tyre, engine and doors too is wrong - the objects don’t die - this example is NOT for composition.
the objects must actually be created inside the constructor of the owner class
When Car dies, so does tyre, engine and doors too is wrong - the objects don’t die - this example is NOT for composition.
the objects must actually be created inside the constructor of the owner class