Spring Framework allows to inject the dependency by setter method also. The
There are following values injected through setter injection.
Spring Framework provides following elements to inject collection values inside
Collection elements can be primitive or object collections.Here we’re taking example of Question class which has multiple answers.
Question class has collection of String for multiple answers.
Spring Framework allows to inject primitive or Object references with collection.There are three XML elements available for this.
• < list >
• < set >
• < map >
For Dependent Object injection we have HAS-A relation scenario.In our case there is dependency of Address object in Customer class.