Spring automatically finds the required dependency from the IoC container and connects it to the dependent class. import org.springframework.beans.factory.annotation.Autowired; import ...