← Quiz: Spring Core and DI: all 10 questions
Quiz: Spring Core and DI · Question 2 of 10
Two beans implement Notifier and one is marked @Primary. A constructor asks for a plain Notifier. Which is injected?
Two beans implement Notifier and one is marked @Primary. A constructor asks for a plain Notifier. Which is injected?
- A.The @Primary one
- B.Both, as a list
- C.Neither — startup fails
- D.A random one
Answer & explanation
Correct answer: The @Primary one
@Primary is the default choice; use @Qualifier to pick the other.
Can you get the rest right without peeking?
Take the timed Quiz: Spring Core and DI quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →