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 Use of Run Time Polymorphism in Java ?

Does Java Allow Virtual Functions ?

What are the Differences Between a HashSet and a HashMap in Java ...

What is a CAS Operation in Java ?

How Will You Sort Objects by Natural Order in a Java List ?