Javatpoint Logo
Javatpoint Logo

Inheriting Bean in Spring

By 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.

This class contains three properties, three constructor and show() method to display the values.

This class gets the bean from the applicationContext.xml file and calls the show method.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA