Intermediate
Object-Oriented Programming Concepts
Q74 / 100
What does it mean to "compose" behaviors via dependency injection?
Correct! Well done.
Incorrect.
The correct answer is B) Supplying a class's dependencies (often as interfaces) from outside, rather than having it create them itself
B
Correct Answer
Supplying a class's dependencies (often as interfaces) from outside, rather than having it create them itself
Explanation
Dependency injection passes required collaborators into a class (e.g. via constructor), improving testability and reducing tight coupling to concrete implementations.
Progress
74/100