Inheritance

Descripción

A small mindmap on inheritance.
Nik Nguyen
Mapa Mental por Nik Nguyen, actualizado hace más de 1 año
Nik Nguyen
Creado por Nik Nguyen hace más de 8 años
87
0

Resumen del Recurso

Inheritance
  1. Defined as a relationship between objects that share characteristics
    1. I.e. -- a new class, aka subclass, is created from an existing class (superclass) by absorbing its state and behavior.
      1. The subclass INHERITS characteristics of its superclass.
      2. In code, the relationship is specified in the declaration of the subclass, using the keyword "extends".
      3. Works by hierarchy
        1. See the following chart:
          1. Person
            1. Student
              1. GradStudent
                1. UnderGrad
                2. Employee
                3. The relationship between classes is called an "is-a" relationship.
                4. Subclasses can only inherit from a superclass. Subclass cannot inherit from another subclass, and a superclass cannot inherit from a subclass.
                  1. 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.
                    1. Subclasses can redefine the method it inherits as well.
                      1. I.E. Gradstudent and undergrad may use different algorithms for computing the course grade by changing the computeGrade method inherited from Student.
                Mostrar resumen completo Ocultar resumen completo

                Similar

                DNA Basics
                Sarah Juliette B
                Missed Questions on Inheritance/Polymorphism Test
                Nik Nguyen
                AQA A2 Biology - Chapter 8 Inheritance and Selection
                Charlotte Lloyd
                Rivers
                littlecscarfe
                OOP (Object Oriented Programming)
                Adam Cook
                Plant Reproduction
                Hannah Walsh
                0654 IGCSE Coordinated Sciences Inheritance Quiz
                Jeffrey Piggott
                Cancer
                Lucy Nove
                Inheritance and Selection Overview
                Mollie Bedford
                Biology- Inheritance and Genetic Diagrams
                Laura Perry
                Psychiatry Genetics
                Matthew Coulson