Exam4Training

Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of the following @Autowired scenarios will cause the ApplicationContext to FAIL to initialize?

Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of the following @Autowired scenarios will cause the ApplicationContext to FAIL to initialize?

Assume that the ApplicationContext is configured to process the @Autowired annotations. (Select one)
A . @Autowired public void setFoo(Foo aFoo) {}
B . @Autowired private Foo foo;
C . Both a and b
D . Neither a or b

Answer: C

Exit mobile version