Chapter 2: class definitions Flashcards

(17 cards)

1
Q

keyword

A

Word like “public” and “class” that are part of the Java language. Also called reserved words

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

field

A

Variables that store persistent data within and object

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

Constructor

A

Responsible for ensuring that an object is set up properly when it is created

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

Method

A

Implements the behavior of an object

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

Scope

A

Defines the section of source code from which a variable can be accessed

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

lifetime

A

Describes how long a variable continues to exist before it is destroyed

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

formal parameter

A

parameter name inside a constructor or method

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

actual parameter

A

value of a parameter inside a constructor or method

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

assignment statement

A

Stores the value represented by the right-hand side of the statement in the variable named on the left

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

method header

A

The part of a method definition that contains the method signature

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

Method body

A

A block of code that contains the declarations and statements that define what an object does when that method is called

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

Block

A

A set of declarations and statements between a pair of matching curly brackets

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

Return statement

A

Statement that terminates execution of a method

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

Accessor method

A

Method that returns information about the state of an object

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

Mutator method

A

Method that changes the state of an object

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

System.out.println

A

Method that prints it parameter to the terminal

17
Q

class header

A

The part of the class definition that provides the name of the class