4.Run it

When you will run above application,you will get following as output.

1

2

3

4

Country Name:India

Country Name:India

When We firstly called getBean and retrieved country object and set countryName to “india” and when second time we called getBean method it did nothing but returned same object with countryName as “india”.

Prototype bean scope

Now we will make change in above xml configuration file.We will add scope attribute in tag and set it to “prototype” and then run it again