Inheritance in Java

Published: 04 November 2021
on channel: Sonic Autolabs
44
2

A class acquiring the characteristics of another class by extending it.
Use case:
If multiple classes/interfaces needs same code then we can create a separate class/interface(parent) and extend it from all other classes/interfaces
Advantage:
Reusability and extensibility
Keyword: extends
Usage(This discussion is only for Classes):
From child classes we can access all the methods and variables of parent but not vice versa
When we run child class all its parent classes will be compiled and loaded.
How to avoid someone to inherit a class?
Single level vs multilevel vs multiple inheritance


On this page of the site you can watch the video online Inheritance in Java with a duration of hours minute second in good quality, which was uploaded by the user Sonic Autolabs 04 November 2021, share the link with friends and acquaintances, this video has already been watched 44 times on youtube and it was liked by 2 viewers. Enjoy your viewing!