✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
1. If you want to use an existing class but its interface does not match the one you need.
or
2. When you want to create a reusable class that interacts with unrelated or unknown classes (that is, those that will not necessarily have interfaces compatible with the class you are expanding).
you will apply