Skip to content
Sharp

Spring Core · interview question

What happens when a Singleton bean is injected with a Prototype bean?

Multiple choiceMediumchapter-9-curatedpremiumspring-corebean-scope
Choose one answer
Answer and explanation

Correct answer

B. A new Prototype instance is created each time it is needed.

Why

When a Singleton bean is injected with a Prototype bean, a new Prototype instance is created each time it is needed if accessed via a method call. This behavior needs careful management to avoid resource waste.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →