ExamGecko
Question list
Search
Search

Question 10 - 2V0-72.22 discussion

Report
Export

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.)

A.
@Autowired public void setFoo (Foo foo) {…}
Answers
A.
@Autowired public void setFoo (Foo foo) {…}
B.
@Autowired @Qualifier (“foo3”) Foo foo;
Answers
B.
@Autowired @Qualifier (“foo3”) Foo foo;
C.
@Autowired public void setFoo (@Qualifier (“foo1”) Foo foo) {…}
Answers
C.
@Autowired public void setFoo (@Qualifier (“foo1”) Foo foo) {…}
D.
@Autowired private Foo foo;
Answers
D.
@Autowired private Foo foo;
E.
@Autowired private Foo foo2;
Answers
E.
@Autowired private Foo foo2;
F.
@Autowired public void setFoo(Foo foo2) {…}
Answers
F.
@Autowired public void setFoo(Foo foo2) {…}
Suggested answer: A, D, F
asked 16/09/2024
R. M.
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first