See the top answer to this question: What exactly is Spring Framework for?
Im at loss as to what the problem is, and why Springs solution of putting specifying what implementation of the interface to use inside an XML file (or using annotations) is better than simply having a line of code instantiate the correct interface?
EDIT: As I wrote in one of my comments, Im genuinely trying to understand the benefits. I want to understand why Spring is useful. Im not advocating not using Spring or trying to provide reasons not to, rather, Im searching for reasons and trying to understand why it should be used. This post was not meant to encourage debate but straightforward and technical answers. I have now selected the shortest and most illustrative answer as the correct answer. I must say Im a bit surprised that the question was closed.
If class A uses class B, DI takes the responsibility of providing the class B to the class A. It is commonly used for testing where Spring would provide a different B class (mock for example).
Sure, you can do all this yourself, but usually it’s less work if you let Spring (or any other DI framework) do this for you.