Chapter 15: Inheritance, Polymorphism, and Abstract Classes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:23 PM on 5/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

43 Terms

1
New cards

Inheritance

A way to create a new class from an existing class. The new class is a specialized version of the existing class.

2
New cards

Base Class

The class being inherited from. Also called the parent class.

3
New cards

Derived Class

The class that inherits from another class. Also called the child class.

4
New cards

Parent Class

Another name for base class.

5
New cards

Child Class

Another name for derived class.

6
New cards

Is-a Relationship

The relationship represented by inheritance. Example: Dog is an Animal.

7
New cards

Creating a Derived Class

Using syntax like class Dog : public Animal. This means Dog inherits from Animal.

8
New cards

Public Inheritance

Inheritance where public base members stay public and protected base members stay protected in the derived class.

9
New cards

Protected Inheritance

Inheritance where public and protected base members become protected in the derived class.

10
New cards

Private Inheritance

Inheritance where public and protected base members become private in the derived class.

11
New cards

Inherited Member

A member from the base class that becomes part of the derived class object.

12
New cards

Base Class Private Member

A private base member is inherited but cannot be directly accessed by the derived class.

13
New cards

Protected Member

A member accessible by the class itself and derived classes, but not outside code.

14
New cards

Constructor Order in Inheritance

When a derived object is created, the base class constructor runs first, then the derived class constructor.

15
New cards

Destructor Order in Inheritance

When a derived object is destroyed, the derived class destructor runs first, then the base class destructor.

16
New cards

Passing Arguments to Base Constructor

A derived constructor can call a base constructor using an initialization list. Example: Square(int s) : Rectangle(s, s).

17
New cards

Constructor Initialization List

The section after a constructor heading that initializes base classes or members. Example: : Base(x).

18
New cards

Constructor Inheritance

Letting a derived class inherit base class constructors using using Base::Base;.

19
New cards

Redefining

A derived class creates a function with the same name and same parameter list as a non-virtual function in the base class.

20
New cards

Overriding

A derived class replaces a virtual function from the base class with its own version.

21
New cards

Redefining vs. Overriding

Redefining is non-virtual and uses static binding. Overriding requires a virtual base function and uses dynamic binding.

22
New cards

Function Overloading

Same function name but different parameter lists. This is different from redefining.

23
New cards

Static Binding

C++ decides which function to call at compile time. Happens with non-virtual functions.

24
New cards

Dynamic Binding

C++ decides which function to call at runtime. Happens with virtual functions.

25
New cards

Virtual Function

A base class function marked with virtual, allowing derived versions to be called through base references or pointers.

26
New cards

Polymorphism

The ability for the same function call to behave differently depending on the actual object type.

27
New cards

Runtime Polymorphism

Polymorphism that happens while the program is running through virtual functions.

28
New cards

Base Class Pointer

A pointer of the base class type that can point to a derived class object.

29
New cards

Base Class Reference

A reference of the base class type that can refer to a derived class object.

30
New cards

Object Slicing

When a derived object is copied into a base object by value, causing the derived part to be lost.

31
New cards

override Keyword

A keyword that tells the compiler a derived function is intended to override a virtual base function.

32
New cards

final Keyword

A keyword that prevents a virtual function from being overridden further.

33
New cards

Virtual Destructor

A destructor marked virtual so deleting a derived object through a base pointer calls the correct destructors.

34
New cards

Abstract Class

A class that cannot be used to create objects because it contains at least one pure virtual function.

35
New cards

Pure Virtual Function

A virtual function with = 0. Example: virtual void show() = 0;.

36
New cards

Concrete Class

A class that can be used to create objects. It has no unimplemented pure virtual functions.

37
New cards

Interface-like Class

A class made mostly or entirely of pure virtual functions, used to define required behavior for derived classes.

38
New cards

Creating Abstract Classes

A class becomes abstract when it has at least one pure virtual function.

39
New cards

Implementing Pure Virtual Functions

A derived class must define inherited pure virtual functions before objects of that derived class can be created.

40
New cards

Multiple Inheritance

A derived class inherits from more than one base class.

41
New cards

Name Conflict in Multiple Inheritance

A problem where two base classes have members with the same name. Use scope resolution to clarify.

42
New cards

Scope Resolution in Inheritance

Using BaseClass::functionName() to specify which class version of a function to call.

43
New cards

Instance of Concept

In C++, an object is an instance of a class. C++ does not have a Java-style instanceof keyword, but base pointers/references can point to derived objects through inheritance.