An array is a list of...
data elements
An array can store any type of data as long as...
they are of the same type
Arrays allow you to create a collection of like values that are....
indexed
Once created, an array size is
fixed and cannot be changed
Two-dimensional arrays are
arrays of one-dimensional arrays
Arrays may be a literal value, a constant, or variable but they cannot be this
A negative number
The length field of the array gives the number of what in an array
elements
A method can return a reference to a(n)...
array
Arrays have a final field named...
length
Each element of a String array is a
String Object
The == operator in an array determines
whether array references point to the same array object
Programs that process 2D arrays can do so with...
Nested Loops
This type of method has a header that looks like this:
public static void main(String[] args)
main method
When processing the data in a two-dimensional array, each element has two subscripts, what are they?
one for its row
one for its column
Declaring a two-dimensional array requires two sets of brackets and two size declarators, what are they both for
The first one is for the number of rows
The second one is for the number of columns.
The array that is passed into the ______ parameter comes from the operating system command-line
args
int[] numbers = new int[6];
float[] temperatures = new float[100];
char[] letters = new char[41];
long[] units = new long[50];
double[] sizes = new double[1200];
Are all examples of what?
Array
String objects have several methods, including
toUpperCase
compareTo
equals
charAt
What is this code finding?
int [] numbers = new int[50];
int highest = numbers[0];
for (int i = 1; i < numbers.length; i++)
{
if (numbers[i] > highest)
highest = numbers[i];
The highest value
This code is summing THIS for a two-dimmensional array
int[][] numbers = {{ 1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12}};
int total;
for (int row = 0; row < numbers.length; row++)
{
total = 0;
for (int col = 0; col < numbers[row].length; col++)
total += numbers[row][col];
System.out.println("Total of row "
+ row + " is " + total);
}
The Rows