Chapter 2 - Classes and Objects Flashcards

1
Q

When designing a class, think about

A

Things the object knows

Things the object does

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

Instance variables

A

Things an object knows about itself

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

Methods

A

Things an object can do

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

State

A

Instance Variables (Knows)

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

Behavior

A

Methods (Does)

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

What represent an object’s state (The Data)

A

instance variables

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

Think of instance as another way of saying

A

object

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

A class is

A

A blueprint for an object

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

One analogy for object is

A

A packet of unused Rolodex cards. Same blank fields (ivars) Create a new card create a new object

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

Dot operator (.) gives?

A

gives access to an object’s state and behavior (ivars and methods)

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

Two uses of main

A
Test your real class
Launch/start a java application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

I represent ‘state’

A

instance variables

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

I declare methods

A

class

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

I am used to create object instances

A

class

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