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

Mind map

Inheritance

Nik Nguyen AP Computer Science Advanced Placement English

Map content

Inheritance

  1. Defined as a relationship between objects that share characteristics

    • I.e. -- a new class, aka subclass, is created from an existing class (superclass) by absorbing its state and behavior.
      • The subclass INHERITS characteristics of its superclass.
    • In code, the relationship is specified in the declaration of the subclass, using the keyword "extends".
  2. Works by hierarchy

    • See the following chart:
      • Person
        • Student
          • GradStudent
          • UnderGrad
        • Employee
      • The relationship between classes is called an "is-a" relationship.
    • Subclasses can only inherit from a superclass. Subclass cannot inherit from another subclass, and a superclass cannot inherit from a subclass.
      • A subclass may inherit the public/protected variables and methods of its superclass, as well as have additional methods and instance variables not in the superclass as well.
        • Subclasses can redefine the method it inherits as well.
          • I.E. Gradstudent and undergrad may use different algorithms for computing the course grade by changing the computeGrade method inherited from Student.

Information

Description
A small mindmap on inheritance.
Created by
Nik Nguyen · Apr 2016
Updated
Jul 28, 2016
Views
129
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?