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 Main Benefit of IOC Principle in Java ?

What are the Main Benefits of Collections Framework in Java ?

What is the Difference Between pass by reference and pass by valu ...

What is the Use of a Dictionary Class in Java ?

What is the Difference Between wait and sleep Methods in Java ?