Inheritance in java:-
As a part of enterprise application developments we have to
represent all the employee levels like manager, accountant, engineer with the
variable eid, ename, eaddr, and with the behavior like hetEmpDetails() ….
If we use the above approach to prepare application then
automatically code duplication will be increased it is not suggestible in application
developments in this context provide code reusability we have to use
“inheritance”. Right between classes.
In case of inheritance, we will declare a generalized class
with common variables and methods and we will extends this generalized class to
any other classes which required the same variable and methods.
The process of getting variables and methods from one class
to another class is called inheritance.
The main objective of inheritance if “code reusability”.
At basic level object orientation there are 2 types of
inheritance.


No comments:
Post a Comment