Chapter 4 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

State

A

what does the object know?

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

behaviors

A

what does it do?

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

Methods define

A

behaviors

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

class

A

blueprint of an object

ex: s.toUppercase();

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

string class is provided, but we can

A

make our own classes

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

constructor method instantiates

A
an object
EX: new Scanner(System.in)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

face variable in the Coin class

A

is called instance data or instance variable

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

___ variables point directly at its values in memory

A

primitive

ex: int, double, boolean

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

____ variables point to the object’s address

A

reference variables

ex: string

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

abstraction

A

can use object without knowing how they work

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

Encapsulation

A

seperates external from internal,

the plastic of the black box

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

Encapsulation internal

A

variables object holds and the methods that make the object useful

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

Encapsulation external

A

the service that an object provides and how it interacts

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

Self governing

A

change to and object’s state should be made through the methods

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

Two visibilty modifiers

A

public and private

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

public visibility

A

class interface, methods

17
Q

private visibility

A

Internal to the object, private

18
Q

private variables

A

getters/accessors, and setters/mutators

19
Q

Code for getter/setter

A

get()/set()

20
Q

Driver program

A

controls and tests other parts of the program

21
Q

Method

A

runs programs when the method is called

22
Q

Method changes flow of control by

A

making it jump to the code within the method and then jumping back

23
Q

method header blueprint

A

visibility return-type method-name(parameter list)

{method body}

24
Q

scope

A

area in which a variable is defined and can be used

25
Q

return type

A

returns a type, void if nothing

26
Q

You have to use a toString method to

A

print out what you want to see

27
Q

precondition

A

a condition that must be true when a method is called

28
Q

postcondition

A

a condition that must be true when a method finishes executing

29
Q

using the same method name for multiple methods is ___, the ___ must be unique

A

overloading, signature