Chapter 8: Multi-Dimensional Arrays Flashcards

1
Q

What’s a two-dimensional array?

A

An array that contains other arrays as its elements, it can form a table (5x5).

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

What’s the syntax for declaring a two-dimensional array?

A

elementType [] [] arrayRefVar;
EXAMPLE
int[][] matrix;

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

What are the two indexes in a multi-dimensional array?

A

Row index and column index

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

What is a ragged array and how does it work?

A

A multi-dimensional array is technically multiple single row arrays stored together in an array. You can have different length arrays inside a multi array, which is called a ragged array.

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

What’s a common way to process a two-way array?

A

Nested for loops. The loop for entering columns should be nested inside the loop for rows.

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