Lets say i have a class Foo defined by @Component annotation:
@Component
public class Foo{
}
Then in configuration class
@Configuration
@ComponentScan
public class Configuration{
@Bean
public Foo foo(){
return new Foo();
}
I've ran it succeed but can some one explain the details of the concept here ? Thanks!