Unit 3 - Arrays Vocabulary Flashcards
Data Structure
Data structures are a collection of related data items. For example: Arrays, Stack (LIFO), Queue (FIFO)
Array
A numbered list that stores data of the same type
Dynamic Resizing
Dynamic resizing is the action of resizing an array (with the help of ArrayList)
Array Element
An array element is a variable inside of an array.
Array Index
The location or position of an element inside of the array.
length (Instance Variable - Field)
A final variable that stores the number of elements in an array.
Array Initializer
A line of code that sets the number of elements in an array. This is formatted using int[ ] array = {element1, element2, etc}
Bounds Checking (also, “off-by-one” error)
The JVM checks the array elements to ensure that their index (position) is greater than or equalled to 0 and less than the array length.
Enhanced For Statement (also, “traverse”)
A for loop that iterates through an array. This is formatted using data type: array name
Pass-By-Value
A pass-by-value takes a copy of the argument value (not the variable itself to ensure that the original variable remains unchanged) and passes it onto the called method (Send values as arguments).
Pass-By-Reference
A reference of the argument value is passed to the method, allowing for the method to access the argument parameter and modify its value. (used to modify the original variable of a value. Sending the memory location (address) in an array.)
Two-Dimensional Array
An array inside of an array is mainly used for making a table of values that are arranged in rows and columns
Command-Line Arguments
Pass arguments from the configuration tab into the public static void main (String [] args) before it runs.
Arrays Class
The array class is from the Java utility package which allows for static array manipulation (sorting searching, filling, comparing or copying).
ArrayList
A class that helps programmers to resize their arrays automatically. ArrayLists automatically grow and shrink when elements are added or taken out.