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 are the Situations in Which You Choose HashSet or TreeSet in ...

What are the Advantages of Multithreading in Java ?

What is the Difference Between Array and ArrayList in Java ?

How Will You Make an Object Immutable in Java ?

How Can We Find the Memory Usage of JVM From Java Code ?