Skip to content
Sharp

Dependency Injection · interview question

How does Spring Boot handle bean instantiation order when using constructor injection?

Multiple choiceHardchapter-9-curatedpremiumdependency-injectionconstructor-vs-field-injection
Choose one answer
Answer and explanation

Correct answer

A. It instantiates beans in dependency order, ensuring all dependencies are available.

Why

Spring Boot uses a dependency graph to instantiate beans in the correct order, ensuring that all dependencies required by a constructor are available before the bean itself is instantiated.

Test yourself on Dependency Injection

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

Start free test
All Dependency Injection questions →