W3 - INHERITANCE Flashcards

_ Inheritance _ Inclusion Polymorphism

1
Q

W3-Q1: CHARACTERISTICS of INHERITANCE

A

_ Inheritance is the TIGHTEST relationship btw classes.

_ the most HIGHLY COUPLED + defined in hierarchical terms + supports both abstraction and polymorphism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

W3-Q2: What does a DERIVED class in an inheritance hierarchy include?

A

the ENTIRE structure of its BASE class and only defines those additional features that specialize its base class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

W3-Q3: Inheritance is a relationship between user-defined types. What are those types?

A

_ CONCRETE types - their representation is part of their definition and is known
_ ABSTRACT types - their representation is NOT part of their definition and is unknown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
#W3-Q3: _ Definition + Characteristics of ABSTRACT classes
_ How can we complete its implementation?
_ Can we create an instance of an ABSTRACT class?
A
_ An abstract class defines an INTERFACE to an inheritance hierarchy. 
_ an INCOMPLETE class in the hierarchy. 
_ by deriving a new class that adds the MISSING details. 
_ cannot
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

W3-Q4: The COMPLETE class is a CONCRETE class. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

W3-Q5: What is a POLYMORPHIC OBJECT?

A

is an OBJECT that can have different types throughout its lifetime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

W3-Q6: What are PROBLEMS that arise with DYNAMIC typing?

A

_ determining the dynamic type in copying a polymorphic object to another polymorphic object
_ specializing an operation for a dynamic type
_ excluding a specific type from most DERIVED selection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

W3-Q7: What does The Liskov Substitution Principle state?

A

a function that uses POINTERS or REFERENCES to BASE classes must be able to use OBJECTS of DERIVED classes without knowing it
=> model our CLASSES on their behaviors NOT their properties and model our DATA based on properties and NOT on behaviors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly