Chapter 12 Flashcards

1
Q

What must any OOP language support?

A

ADT
Inheritance
Polymorphism

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

Why is Inheritance needed?

A

Can increase productivity (reuse)

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

What are some OO concepts?

A

ADT (classes)
class instances (objects)
class that inherits (derived/subclass)
parent class
subprograms defining operations on objects (methods)
Calls to methods (messages)
collection of an object’s methods (message protocol/interface)
2 parts in message (method name, dest object)

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

What are the 2 kinds of variables in a class?

A

Class variables (one per class)
Instance variables (one per object)
same for methods

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

What is Dynamic binding?

A

Polymorphic reference (pointer)

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

When everything is an object what are the advantages and disadv?

A

Adv: elegance
Disadv: slow

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

When you add objects to a complete typing system what happens?

A

Speed up simple operations
Results in confusing type system

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

When using an imperative typing system for primitives and make everything else object what happens?

A

Simple operations can be fast but typing system remains small
but 2 type systems has to mix

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

What does dynamic binding look like in C++?

A

virtual key word, interface in java

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