What is dependency injection? Classes often require references to other classes. For example, a Car class might need a reference to an Engine class . These required classes are called dependencies, and in this example the Car class is dependent on having an instance of the Engine class to run.