GoConqr has a new look! Let us know what you think.

Mind map

Inheritance

Tate Johnson Computer Science English

Map content

Inheritance

  1. process of deriving a new class from an existing one.

  2. Super class cannot access child instance data or methods unless its public.

    • Child class CAN access PUBLIC data/methods of parents
      • Child class CANNOT access PRIVATE data/methods of parent
  3. Reserved word: extends

    • You can only extend ONE class.
  4. protected: can only be accessed by the child of the parent class

  5. Super: gives access to parent's data/methods

    • Called like: super() or super(value)
      • **If the first line in the Child's constructor is not a call to the parent class. Java implicitly places a super there. With no params**
        • Exception: a chained call to another constructor in same class will automatically defer super to that class.
          • super(xxx) --> call to parent class constructor
            • super.xxx --> call to parent class instance data
              • super.xxx() --> call to parent class method
  6. Overriding:

    • When a child class defines a method w/ the same name and signature as the parent. The child version overrides the parents.
      • How to implement: @Override before the method
        • *Static methods can be inherited but NOT overriden.

Information

Description
Computer Science Mind Map on Inheritance, created by Tate Johnson on 27/04/2021.
Created by
Tate Johnson
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?