91-9990449935 0120-4256464 |
Inheriting Bean in SpringBy using the parent attribute of bean, we can specify the inheritance relation between the beans. In such case, parent bean values will be inherited to the current bean. Let's see the simple example to inherit the bean. Employee.javaThis class contains three properties, three constructor and show() method to display the values. Address.java applicationContext.xml Test.javaThis class gets the bean from the applicationContext.xml file and calls the show method.
download this example (developed using MyEclipse IDE)
download this example (developed using Eclipse IDE) |