How Will You Define the Scope of a Bean in Spring ?

In configuration xml, we can specify the scope of bean in its definition. This is used by container to decide the scope of bean in Spring.

E.g.

This is an example of userService bean with prototype scope.



You May Interest

What is the Purpose of Properties File in Java ?

How Will You Create a Shallow Copy of a Map in Java ?

What are the Atomic Operations in Java ?

What are the Different States of a Thread in Java ?

What are the Different Types of Classloaders in Java ?