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

Why Should You Define a Default Constructor in Java ?

What are the Advantages of Using JSP in Web Architecture ?

What is the Lifecycle Stages of JSP ?

What are the Differences Between Comparable and Comparator in Jav ...

What is Volatile Keyword in Java ?