Read here: https://www.concretepage.com/spring/e...
Inner beans are always created within the parent bean. Inner beans are created within the property element in the setter method dependency injection or within constructor-arg element in constructor argument dependency injection.