Suppose two classes ClassA and ClassB. Lets suppose ClassB is dependent on ClassA. On configuration file, if we define scope of ClassA to be singleton and that of ClassB to
What happens to instance of ClassB each time we create a bean instance of ClassA?
Since ClassA is a singleton, an single instance will be shared among all the instances of ClassB.
Will the same ClassB instance gets returned or new instance is created each time instance of ClassA is returned?
I think here you meant Will the same ClassA instance gets returned or new instance is created each time instance of ClassB is returned?
Everytime an instance of ClassB is created the shared ClassA instance will be (re-)used.