Exercise: Composite Design Pattern
Test your understanding of the composite design pattern and add a leap node.
We'll cover the following
Problem statement
Modify the example code in the previous lesson and add the following functionalities:
- Add a new leap class called a
Circle
. - Make some instances of the
Circle
and add them to thegrafik1
orgrafik2
objects. - The leaf objects of the
Circle
class should printCircle.
Coding challenge
Get hands-on with 1400+ tech skills courses.