Chapter 4 Flashcards

1
Q

What does the class header contain?

A
  • An optional acess specifier
  • The keyboard class
  • Any legal identifier
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a public class?

A
  • Accessible by all objects
  • Can be extended as a basis for another class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are data fields?

A

The data components of a class

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

What are instance variables?

A
  • Nonstatic fields in a class
  • One copy exists for each object instantiation
  • Each object gets its own copy of each nonstatic data field in its class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is private access?

A
  • No other classes can access the field’s values
  • Only methods of the same class are allowed to use private variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is information hiding?

A
  • Principle used in creating private access
  • Private data can be change only by a class’s own method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are mutator methods?

A
  • Set or change field values
  • Called setters
  • Start with prefix set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are accessor methods

A
  • Retrieve values
  • Called getters
  • Start with prefix get
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are class fields

A

Static data fields

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

What is an abstract data type?

A
  • A class you create
  • Implimentation is hidden and accessed through public methods
  • Also called programmer-defined data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How many copies of nonstatic methods in a class are stored?

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

What is a library of classes?

A
  • A package or folder that groups like prewritten classes together
  • Java.lang includes fundamental classes and is automatically imported into every program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly