What is dependency injection ?
It just means to inject dependency.Dependency is any object that your class needs to function.
Dependency via @Bean anotatation
Generate a maven project make sure you have the spring-context dependency in your project pom.
Make a new folder config
to store call the configuration files.Inside the folder create a java file called projectconfig.java
to store the config details.
package config;
import org.springframework.context.annotation.Configuration;
@Configuration
public class projectConfig {
}