Inheritance

In Java, the following terms are often used:

  • Super Class - the topmost part of the class
  • Parent Class - the class before the child class
  • Child Class - the last class in the program
To understand fully, here's a sample of a family tree.







Obviously, the child (classes) are the following:

  • Me
  • Brother
  • Sister
  • Cousin; and
  • OTHER Cousin
The Parent Classes are:
  • Mommy and Daddy Smith
  • Uncle and Aunt Trotter
  • Aunt and OTHER A.N
The Super Class are:
  • Grandad and Granny Jones
  • Great Grandad and Great Granny Bloggs
However, Java does not support multiple inheritance. Java can only hold one Super Class, one Parent Class, and one Child Class.

No comments:

Post a Comment

Extended Search

Custom Search
Hello World