Chapter 4 - Writing Classes Flashcards

1
Q

SR 4.1

What is an attribute?

A

v

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

SR 4.2

What is an operation?

A

An operation is a function that can be done to or done by an object. For example, one operation of a Student object might be to compute that student’s current grade point average. Collectively, an object’s operations are referred to as the object’s behaviors.

(In Java, an object’s operations are defined by methods declared within a class.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
SR 4.3
List some attributes and operations that might be defined for a class called Book that represents a book in a library.
A

v

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

SR 4.4

A

v

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

SR 4.5

What is the difference between an object and a class?

A

A class is the blueprint of an object. It defines the variables and methods that will be a part of every object that is instantiated from it. But a class reserves no memory space for variables. Each object has its own data space and, therefore, its own state.

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

SR 4.6

A

v

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

SR 4.7

A

v

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

SR 4.8

A

v

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

SR 4.9

A

v

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

SR 4.10

A

v

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

SR 4.11

A

v

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

SR 4.12

A

v

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

SR 4.13

A

v

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

SR 4.14

A

v

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

SR 4.15

A

v

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

SR 4.16

A

v

17
Q

SR 4.17

A

v

18
Q

SR 4.18

A

v

19
Q

SR 4.19

A

v

20
Q

SR 4.20

A

v

21
Q

SR 4.21

A

v

22
Q

SR 4.22

A

v

23
Q

SR 4.23

A

v

24
Q

SR 4.24

A

v

25
Q

SR 4.25

A

v

26
Q

SR 4.26

A

v

27
Q

SR 4.26

A

v

28
Q

SR 4.28

A

v

29
Q

SR 4.29

A

v

30
Q

SR 4.30

A

v

31
Q

SR 4.31

A

v

32
Q

SR 4.32

A

v

33
Q

SR 4.33

A

v

34
Q

SR 4.34

A

v

35
Q

SR 4.35

A

v