Comprog3 Midterm (Inheritance and Polymorphism)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

Inheritance

object-oriented principle where a child class (derived/subclass) reuses behavior of a parent class (base/superclass). C# supports only single inheritance. Uses colon (:) syntax.

2
New cards

Protected Members of a Class

members declared with protected are accessible by derived classes. Declared using protected keyword.

3
New cards

Base

keyword used to call base class constructors or methods from a derived class.

4
New cards

Method Overriding

defining a method in a derived class with the same name and signature as in the base class, providing new behavior. Requires base class method to be virtual or abstract. Derived class uses override.

5
New cards

abstract class

a class that cannot be instantiated. Declared with abstract keyword. Used to provide outline for derived classes.

6
New cards

abstract methods

method declarations inside abstract classes without implementation. Must be overridden in derived classes. Declared with abstract keyword and semicolon.

7
New cards

Polymorphism

“many forms.” Classes provide multiple methods with the same name but different behaviors.

8
New cards

Compile time polymorphism

achieved using method overloading (static polymorphism, early binding).

9
New cards

Runtime polymorphism

achieved using method overriding (dynamic polymorphism, late binding).

10
New cards

Explore top flashcards

CGT 163 Exam 1
Updated 967d ago
flashcards Flashcards (81)
Chapter 1 & 2
Updated 231d ago
flashcards Flashcards (65)
Body Mechanics
Updated 197d ago
flashcards Flashcards (34)
Biology term 1 y9
Updated 883d ago
flashcards Flashcards (49)
CGT 163 Exam 1
Updated 967d ago
flashcards Flashcards (81)
Chapter 1 & 2
Updated 231d ago
flashcards Flashcards (65)
Body Mechanics
Updated 197d ago
flashcards Flashcards (34)
Biology term 1 y9
Updated 883d ago
flashcards Flashcards (49)