Is spring default scope singleton or not?

前端 未结 8 739
悲哀的现实
悲哀的现实 2020-11-28 08:17

Could you please explain why Spring is creating two objects for the configuration of beans shown below, since by default spring default scope is singleton?

The Sprin

8条回答
  •  时光说笑
    2020-11-28 08:23

    In Spring Singleton refers to One bean per Spring container where as in Java Singleton refers to one object per class loader.

    So Spring singleton is not same as java singleton. Don't get confused between these two.

提交回复
热议问题