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

Mind map

Inheritance

Jeremy Deleon English

Inheritance

Map content

Inheritance

  1. Extend

    • Done automatically in Java as an Object is the superclass
      • Notation:
  2. The Is-a Relationship

  3. Superclass and subclasses

  4. Accessibility

    • P and C: P has three methods, public, protected and one with default class
      • The subclass C can access all these classes but a method outside of the subclass cannot access the default class
  5. Method Overriding

    • You can change the behavior of a method in a parent class by writing the new method in the subclass. This is possible to do for the public and protected methods. If subclass and superclass are in the same package, then you can also change default access level.
      • You can avoid overriding a method by writing final.
  6. Calling a superclass' no-arg constructor

  7. Calling a superclass' hidden members

      • The Pencil class overrides the toString method in Tool. When you run the Pencil class, you get "Generic Tool// I am a Pencil'
  8. Casting

    • Upcasting: casting an object to a parent class by assigning the object to a reference variable of the parent class
    • Downcasting:casting down an object a class down the inheritance hierarchy. You need to write the object in brackets. Subclass needs to exist in the parent class as a reference or else you get an error
  9. instanceof Keyword: used to test if a object is of a specified type. It is normally used an in if statement.

Images and files in the map

  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance

Information

Description
Mind Map on Inheritance, created by Jeremy Deleon on 06/08/2019.
Created by
Jeremy Deleon
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?