Intermediate Object-Oriented Programming Concepts
Q71 / 100

What is the benefit of programming "to an interface" rather than a concrete implementation?

Correct! Well done.

Incorrect.

The correct answer is B) It decouples client code from specific implementations, allowing different implementations to be swapped in without changing client code

B

Correct Answer

It decouples client code from specific implementations, allowing different implementations to be swapped in without changing client code

Explanation

Depending on an interface means the underlying implementation can change or be replaced (e.g. for testing with mocks) without affecting code that uses it.

Progress
71/100