Java Unit 4 - Arrays & ArrayLists Flashcards

1
Q

Term: Array

A

Definition: A data structure in which items are arranged as a numbered sequence, and each item can be referred to by its position number. In Java, all items in an array must be of the same type, and numbering starts at zero.

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

Term: Base Type

A

Definition: The type of the individual items in an array is called the base type of the array. It determines the data type of the elements within the array.

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

Term: Index

A

Definition: The position number of an item in an array is called the index of that item. Indexing starts at zero in Java.

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

Term: Random Access

A

Definition: The ability to access any element in an array directly, without the need to traverse the elements sequentially.

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

Term: Sequential Access

A

Definition: Accessing elements in an array one after the other in the order they occur in the array.

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

Term: Partially Full Arrays

A

Definition: Arrays where the number of items stored in the array can change during program execution. A separate counter variable is often used to keep track of the number of valid items in the array.

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

Term: Two-dimensional Arrays

A

Definition: Arrays in which elements are arranged in rows and columns, creating a grid structure. They are useful for representing data in a tabular form.

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

Term: Nested Loops

A

Definition: Using multiple loops, one inside the other, to efficiently process two-dimensional arrays, allowing access to individual elements by specifying both row and column indices.

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

Term: Element

A

Definition: Individual values stored within an array. Elements are accessed using their index.

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

Term: Array of Arrays

A

Definition: A two-dimensional array can be thought of as an array of arrays. Each β€œsub-array” represents a row, and elements within a row are accessed using both row and column indices.

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

Term: Data Structure

A

Definition: A collection that consists of a number of data items chunked together so that they can be treated as a unit.

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

What is the syntax for declaring and initializing an array?

A

array-variable = new base-type[array-length];

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