Challenge 3: Playing with Cars and Engines!

In this exercise, you have to perform composition between the Toyota class and its Engine!

We'll cover the following

Problem Statement

You have to create a Toyota class which inherits from a Car class, and is composed of an Engine

Note: You already know that in such a composition relation, the Toyota class will be responsible for Engine’s lifetime.

Consider this diagram for reference:

Get hands-on with 1400+ tech skills courses.