The main reason you’d do this is to decouple your code from a specific implementation of the interface. When you write your code like this:
The main reason you’d do this is to decouple your code from a specific implementation of the interface. When you write your code like this: