Skip to content
Sharp

Spring Core · interview question

How would you explain a potential risk of using field injection instead of constructor injection in a Spring-managed transactional service in an interview?

Multiple choiceHardchapter-9-curatedpremiumspring-coretransactions-and-proxies
Choose one answer
Answer and explanation

Correct answer

B. Uninitialized fields at runtime

Why

Field injection can lead to issues where dependencies are not properly initialized before use, especially in transactional contexts. Constructor injection enforces initialization order, reducing this risk.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →