Chapter 7 Flashcards
Lists and tables of values can be stored in _____ and _____.
arrays, collections
An array is a group of _____ (called elements or components) containing values that all have the same _____.
variables, type
The _____ allows you to iterate through an array’s elements without using a counter.
enhanced for statement
The number used to refer to a particular array element’s ______.
index (or subscript or position number)
An array that uses two indices is referred to as a(n) _____ array.
two-dimensional
Use the enhanced for statement ______ to walk through double array numbers.
for (double d : numbers)
Command-line arguments are stored in ______.
An array of Strings args
Use the expression ______ to receive the total number of arguments in a command line. Assume that command-line argments are stored in String[] args.
args.length
Given the command java MyClass test, the first command-line argument is ______.
test
A(n) ______ in the parameter list of a method indicates that the method can receive a variable number of arguments.
ellipsis(…)
(T or F) An array can store many different types of values.
False. An array can store only values of the same type.
(T or F) An array index should normally be of type float.
False. An array index must be an integer or an integer expression.
(T or F) Command-line arguments are separated by commas.
False. Command-line arguments are separated by white space.