Yes, The question is very basic. Dependency Injection is one of the fundamental functionality of Spring framework. Java classes should be independent as possible, this increases the flexibility to reuse the classes and testing classes independently. For this decoupling, the dependency of one class to another class should be injected into them by a third party rather than the class itself creates the other object.
In Spring framework, a light weight container called Spring core container performs dependency injection. ie this container will inject required dependencies in required objects.
In Web application, there will be a controller class, a service class, a dao class etc. In controller class there will be reference to service class, in service class there will be a reference to dao class. When using spring, the dependencies can be configured using XML or annotation or Java config.
Take the scenario between controller class (MyController.java) and service class (MyService.java),
In the xml configuration file, we define the dependency as follows,
<bean id="myService" class="com.service.MyService"/>
<bean id="myController" class="com.web.MyController">
<property name="myService" ref="myService">
</bean>
When controller bean is created, the dependency will be resolved by the core container.