CS180 Week 12: Polymorphism and Abstraction

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/6

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.

7 Terms

1
New cards

Abstract class

cannot be instantiated, some methods may be unimplemented, may include some implemented methods with defualt methods

2
New cards

dynamic binding

methods selected at runtime based on the class of the objects referenced, not the class of the variable that holds the object reference

3
New cards

why polymorphism?

generic treatment of objects, ex) array of animals, programmer must be disciplined to ensure overridden methods consistently implement expected behavior.

4
New cards

what fields does a subclass contatin

its own and superclass

5
New cards

if you have even one abstract method, the whole class needs to be

abstract also

6
New cards

true or false abstract classes can have instance vriables

true -> name vs dog name

7
New cards

abstract methods

may be declared abstract, provide only header no body, class must then also be declared abstract