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

Mind map

Inheritance

Joyce Xie English

Map content

Inheritance

  1. extending a class

    • creating a new class
      • child class/subclass of parent
        • opportunity to add functionality that does not exist in original
          • change behavior of existing class
  2. Extends Keyword

    • all java classes automatically extend the java.lang.Object class
      • Object = superclass
        • parent, by default is a subclass of Object
  3. Relationship

    • example: bird, fish, dog are all subclasses of animal
  4. Accessibility

    • within subclass, access superclass and protected methods and fields
      • cannot access superclass's private methods from subclass
  5. Method Overriding

    • override method to change behavior
      • override by writing new method in subclass
        • don't have to change anything in parent class
  6. Calling Superclass's constructors

    • Implicit calling to the parent's constructor that does not exist
      • compile error
        • compiler adds an implicit call to no argument constructor in Parent
  7. Calling the superclass's Hidden Members

    • using super to access hidden member
  8. Type Casting

    • FInal classes

Information

Description
Mind Map on Inheritance, created by Joyce Xie on 21/11/2019.
Created by
Joyce Xie
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?