Changes between Version 13 and Version 14 of ControlSystems/SoftwareTeam/Training/GettingStarted/IntroJava


Ignore:
Timestamp:
Oct 7, 2019, 11:44:33 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/IntroJava

    v13 v14  
    186186}}}
    187187
    188 === Inheritence
     188=== Inheritance
    189189Classes can be extended so that you don't need to replicate lots of code.  This is particularly useful when there is a hierarchical relationship between classes.  For example, you can define a class Fruit and then extend it with sub-classes Orange, Apple, Banana.  Each of the sub-classes meets the "isa" test: an Apple isa Fruit.  When a class extends another class, it inherits all of the attributes and functions of the parent (super) class.  So for example consider the following classes:
    190190{{{