2: Chapter 8 Flashcards

1
Q

Object-oriented programming

A

Reasoning about a program as a set of objects rather than as a set of action.

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

Object

A

A programming entity that contains state (data) and behavior (methods).

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

State

A

A set of values (internal data) stored in an object.

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

Behavior

A

A set of actions an object can perform, often reporting or modifying its internal state.

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

Client (or client code)

A

Code that interacts with a class or objects of that class.

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

Field

A

A variable inside an object that makes ip part of its internal state.

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

Instance method

A

A method inside an object that operates on that object.

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

Implicit parameter

A

The object that is referenced during an instance method call.

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

Mutator

A

An instance method that modifies the object’s internal state.

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

Accessor

A

An instance method that provides information about the state of an object without modifying it.

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

this

A

A Java keyword that allows you to refer to the implicit parameter inside a class.

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

Encapsulation

A

Hiding the implementation details of an object from the clients of the object.

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

Abstraction

A

Focusing on essential properties rather than inner details.

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

Class invariant

A

An assertion about an object’s state that is true for the lifetime of that object.

A description of something that must always be true of any instances of the class.

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

Cohesion

A

The extent to which the code for a class represents a single abstraction.

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