Skip to content
Sharp

Dependency Injection · interview question

What role does the Spring IoC container play in dependency injection?

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

Correct answer

A. It manages object creation and injection

Why

The Spring IoC (Inversion of Control) container is responsible for managing the lifecycle of beans, including their creation and the injection of dependencies, allowing developers to focus on business logic rather than object instantiation.

Test yourself on Dependency Injection

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

Start free test
All Dependency Injection questions →