Schandha Ravi wrote:From the output, I observe that the constructor of Person is invoked when IoC instantiates Student as expected. But when I try displaying the ID and Name, they are displayed as null. Doesn't Spring container assign the values for parent object, before setting them to child object.
Spring doesn't know anything unless you tell it. That is those are just two beans spring instantiates. I haven't tried it but check
this