1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Array Definition
A collection of like values that are indexed. It is an object in Java and can store only one data type at a time.
Default Initialization
Numeric array elements are automatically initialized to 0; boolean arrays initialize to `false`; object references initialize to `null`.
Array Size Declaring
Once created, an array's size cannot be changed. The size must be a non-negative integer.
Bounds Checking
Java performs runtime bounds checking. Accessing an invalid index throws a runtime error (`ArrayIndexOutOfBoundsException`).
The `length` Field
A built-in, read-only constant field containing the number of elements in the array.
Enhanced `for` Loop
A specialized loop designed to iterate through every element of an array without using counters.
Array Initialization
Declaring and populating an array simultaneously without explicitly using the `new` operator.
Array Assignment Copying
Assigning one array variable to another only copies the reference, not the array object itself.
True Array Cloning
To copy an array completely, you must copy individual elements or use cloning methods.
Arrays as Arguments
When passed to methods, a reference to the array is passed. The method can modify the original array.
Returning Arrays
A method can return a reference to a newly created array.
String Arrays
Arrays storing references to String objects. Calling methods on uninitialized elements throws an error.
Arrays of Objects
Arrays that store references to objects. Each element must be instantiated individually after the array is created.
Sequential Search
A simple algorithm that steps through an array element by element until the target value is found or the end is reached.
Parallel Arrays
Two or more arrays that contain related data, where elements at the same index correspond to each other.
Two-Dimensional Arrays
An array of arrays, representing data organized in rows and columns.
Ragged Arrays
A 2D array where the rows have different lengths. Created by allocating rows individually.
Selection Sort
A sorting algorithm that finds the smallest element in the remaining unsorted portion and swaps it with the current index.
Binary Search
A fast search algorithm that repeatedly divides a *sorted* array in half to find a target value.
Command-Line Arguments
Arguments passed to the `main` method from the execution environment, stored in the `String[] args` array.
The `ArrayList` Class
A class in the `java.util` package providing a dynamically resizing array-like structure.
`ArrayList.add()`
Appends an item to the end of the list, or inserts it at a specified index.
`ArrayList.size()`
Returns the number of items currently stored in the ArrayList.
`ArrayList.get()` & `set()`
`get(index)` retrieves an item at a specific index. `set(index, item)` replaces an existing item.
`ArrayList.remove()`
Removes an item at a specific index or removes the first occurrence of a specific object.