Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
8 Cards in this Set
- Front
- Back
A single array variable |
can reference a large collection of data |
|
Array basics |
once an array is created, its size is fixed an array reference variable is used to access the elements in an array using an index |
|
Declaring an array variable |
elementType[] arrayRefVar; |
|
New operator |
you can create an array by using the new operator and assign its reference to the variable arrayRefVar = new elementType[arraySize]; this creates an array using new elementTYpe[arraySize] and it assigns the reference of the newly created array to the variable araryRefVar |
|
Array length |
the size of an array cannot be changed after the array is created |
|
indexed variable |
arrayRefVar[index]; |
|
array initializer |
combines the declaration, creation, and initialization of an array in one statement using the following syntax elementType[] arrayRefVar = {value0, value1, ..., valuek}; double[] myList = {1.9, 2.9, 3.4....etc}; |
|
Processing arrays |
often use a for loop all elements in an array are of the same type they are evenly processed in the same fashion repeatedly using a loop since the size of the array is known it is natural to use a for loop |