@Bean
public CompactDisc sgtPeppers(){
return new SgtPeppers();
}
@Bean
public CompactDisc hardDaysNight(){
return new HardDaysNight();
}
@Bean
public CDPlayer cdPlayer(CompactDisc compactDisc){
return new CDPlayer(compactDisc);
}
能通过什么注解指定注入的类么?
Anda boleh menentukan nama Bean melalui
sebelum parameter@Bean(name = "beanName")
; kemudian tambah@Qualifier("beanName")