Reputation: 33
How Many Objects will be created into container. if configuration will be as given below.
<bean id = "helloWorld" class = "com.tutorialspoint.HelloWorld"><br/>
<property name = "message" value = "Hello World"/>
</bean>
<bean id = "helloWorld1" class = "com.tutorialspoint.HelloWorld">
<property name = "message" value = "Hello World"/>
</bean>
Upvotes: 0
Views: 128
Reputation: 939
One singleton object per definition in the spring container, if you define N beans then N singleton object of the class will be created.
It will create two instances in your case, by definition Spring container creates a singleton instance per bean.
Upvotes: 1