Week #4: Inheritance
Inheritance is when the functions from a super class also apply to a sub class of the super class. This is important because then a person will not have to repeat functions in each class. The super class outlines the generic layout for the specific sub classes to come. If it important to have a function in the subclasses but it will be different for each sub class the programmer can write the function definition and write and exception for the code so that it is clear that it is needed for the future sub classes.
No comments:
Post a Comment