Chapter 10: How to work with arrays Flashcards

1
Q

What is an Array?

A

An array is an object that contains one or more items called elements.

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

What are the methods associated with a the Array class?

A

type arrayName[] = new type[length];

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

Describe one and two dimensional array

A

One dimension array uses a single index, whereas, two dimensional arrays use two indexes and can be thought of as columns and rows.

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

Describe the “enhanced” loop

A

The enhanced, or foreach, loop doesn’t use separate expressions to initialize, test, and increment a counter variable. Instead it declares a variable that’s used to refer to each element of the array. for (type variableName : arrayName) {statements};

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