1/13
Flashcards covering Java programming concepts including 1D and 2D arrays, ArrayList syntax, and standard iteration methods based on the Unit 4 practice exam.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Array Length Property
The property used to determine the total number of elements in an array, such as int[] nums = new int[5]; having a length of 5.
Valid Array Declaration
A syntax like String[] colors = {"Red","Blue","Green"}; or double[] grades = {88.5,91.2,77.8}; that properly initializes an array with specific values.
Array Index Access
The syntax used to retrieve or modify an element, such as values[(values.length-1)] which accesses the last element of an array.
names[i].contains("Smith")
A boolean method used within a loop to check if a specific string element in the names array contains the sequence "Smith".
words[i].length()
A method used to return the number of characters in a string element located at index i of the words array.
2D Array Initialization
The syntax int[][] nums={ {1,2,3}, {4,5,6} }; which creates a multidimensional array containing rows and columns.
Row-Major 2D Array Creation
The syntax int[][] board=new int[5][8]; which correctly creates a 2D array structure consisting of 5 rows and 8 columns.
data.length (2D Array)
The property of a 2D array that returns the number of rows contained within the structure.
data[0].length
The property of a 2D array that returns the number of columns in the first row.
Nested For-Loops (2D Arrays)
A control structure where an outer loop iterates through rows (r<array.length) and an inner loop iterates through columns (c<array[r].length).
ArrayList.size()
The specific method used to return the current number of elements stored in an ArrayList.
ArrayList Type Constraint
A rule in Java stating that ArrayList cannot use primitive types (e.g., double); it must use wrapper classes (e.g., Double).
ArrayList.get(i)
The method used to retrieve an element at index i from an ArrayList, as the square bracket syntax list[i] causes a Compiler Error.
ArrayList.remove(index)
A method that deletes the element at the specified index and shifts all subsequent elements to the left, effectively changing their index positions.