Bean Scope

Learn about the differences between singleton and prototype bean scopes and how to implement them.

The Spring container manages beans. The term bean scope refers to the lifecycle and the visibility of beans. It tells how long the bean lives, how many instances of the bean are created, and how the bean is shared.

Types of bean scopes

There are six types of scopes: singleton, prototype, request, session, application, and websocket.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.