if ClassB is a prototype, a new instance of ClassB is always created; it does not care about other classes when created.
So, the prototype of ClassB and the unicast single ClassA, at some point you could have N instances of ClassB and only 1 from ClassA in your application.
In your case, since only one instance of ClassA will exist in the life cycle of your application, it will have only one instance of ClassB that will be different from any other ClassB referenced by other beans in your application
Ramonboza
source share