← Quiz: Spring Core and DI: all 10 questions
Quiz: Spring Core and DI · Question 7 of 10
Which error do you get when two beans of the same type exist and neither is @Primary nor selected by @Qualifier?
Which error do you get when two beans of the same type exist and neither is @Primary nor selected by @Qualifier?
- A.NoUniqueBeanDefinitionException
- B.NoSuchBeanDefinitionException
- C.NullPointerException
- D.BeanCreationNotAllowedException
Answer & explanation
Correct answer: NoUniqueBeanDefinitionException
Spring cannot decide which of the two candidates to inject.
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 →