Skip to content
Sharp

Dependency Injection · interview question

In Spring Boot, how does lazy initialization of beans affect constructor injection?

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

Correct answer

A. Lazy initialization can delay bean creation until first use

Why

Lazy initialization delays the creation of beans until they are needed. While constructor injection can still be used, the actual construction of the bean will not occur until the bean is first accessed, which is useful for optimizing startup performance.

Test yourself on Dependency Injection

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

Start free test
All Dependency Injection questions →