DI is a software development technique where we can create objects that depend on other objects. DI helps with interaction between classes but at the same time keeps the classes independent.
There are three types of classes in DI:
A service is a class that can be used (this is the dependency).
The client is a class that uses the dependency.
The injector passes the dependency (the service) to the dependent class (the client).