How does the prototype scope work in Spring?

Prototype scope in Spring creates a new bean instance every time the bean is requested from the Spring IoC container. Unlike Singleton scope, where the same object is shared, Prototype scope ensures that each request receives a completely separate object.

Key Points

Example

A ReportGenerator bean that stores report-specific data should use Prototype scope so that each report request receives a fresh object.

@Component
@Scope("prototype")
public class ReportGenerator {
}

Interview Tip

A concise interview answer is

In Prototype scope, Spring creates a new bean instance every time the bean is requested from the container. It is typically used for stateful components where each request requires an independent object.

Quick Comparison

Singleton Scope

Prototype Scope

Last updated: 11 November 2026

Previous question: Which design patterns are used in the Spring Framework?

Next question: What are Spring Profiles and how do you use them?

More Spring Framework - Level I interview questions

All Spring Framework - Level I questions