Spring 容器中将有多少个实例?

How many instances will be there in Spring container?

我在 Spring 中有一个查询,将默认范围考虑为单例,如果我写 xml 文件如

<bean id="singletonscope1" class="com.javabeat.HelloWorld" scope="singleton">

 <bean id="singletonscope2" class="com.javabeat.HelloWorld" scope="singleton">

spring 容器将生成多少个实例?

这将生成两个具有不同 bean 的单独实例 ids.Within 一个 spring 容器,每个 bean 都有自己唯一的 ID。