Comprog3 Midterm (Inheritance and Polymorphism)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
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
Call with Kai

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