Given an ApplicationContext containing three bean definitions of type Foo with bean ids foo1, foo2, and foo3, which three @Autowired scenarios are valid and will allow the ApplicationContext to initialize successfully? (Choose three.)
- @Autowired public void setFoo (Foo foo) {...}
- @Autowired @Qualifier ("foo3") Foo foo;
- @Autowired public void setFoo (@Qualifier ("foo1") Foo foo) {...}
- @Autowired private Foo foo;
- @Autowired private Foo foo2;
- @Autowired public void setFoo(Foo foo2) {...}
Reveal Solution Next Question