What is Spring Dependency Injection

Dependency Injection Overview:
Every application-based Java has several objects that work together
An application that presents the work as seen by the end user. When writing a complex
In a Java application, the application class should be as independent as possible
Increase the possibility of reusing these classes. Dependency Injection (or sometimes called cabling)
helps to glue these classes together while keeping them separate.

There are two ways to achieve dependency injection:
Set method injection and constructor injection

Comparison of 2 ways to achieve addiction injection:
When injecting with the construction method, only 2 digits need to be changed based on the method injection set. The first is to use the class's set method to switch to the construction method. Change the property tag to the constructor argument tag.
There is also annotation injection
implementation
Inject class A into class b
XML file
Class aClass B

Test class