Skip to content
Sharp

Spring Core · interview question

When using constructor injection, what happens if a required dependency is missing?

Multiple choiceHardchapter-9-curatedpremiumspring-corecontrollers-services-repositories
Choose one answer
Answer and explanation

Correct answer

D. A BeanCreationException is thrown at startup.

Why

If a required dependency is missing when using constructor injection, Spring will throw a BeanCreationException at startup. This ensures that all necessary components are available and the application can run reliably.

Test yourself on Spring Core

A free test with instant, explained results. No account needed.

Start free test
All Spring Core questions →