• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/28

Click to flip

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;

28 Cards in this Set

  • Front
  • Back

In an array declaration, this indicates the number of elements that the array will have.a. subscriptb. size declaratorc. element sumd. reference variable

b

Each element of an array is accessed by a number known as a(n) __________.a. subscriptb. size declaratorc. addressd. specifier

a

The first subscript in an array is always ___________.a. 1b. 0c. 21d. 1 less than the number of elements

b

The last subscript in an array is always __________.a. 100b. 0c. 21d. 1 less than the number of elements

d

Array bounds checking happens __________.a. when the program is compiledb. when the program is savedc. when the program runsd. when the program is loaded into memory

c

This array field holds the number of elements that the array has.a. sizeb. elementsc. lengthd. width

c

This search algorithm steps through an array, comparing each item with the searchvalue.a. binary searchb. sequential searchc. selection searchd. iterative search

b

This search algorithm repeatedly divides the portion of an array being searched inhalf.a. binary searchb. sequential searchc. selection searchd. iterative search

a

This is the typical number of comparisons performed by the sequential search on anarray of N elements (assuming the search values are consistently found).a. 2Nb. Nc. N2d. N/2

d

When initializing a two-dimensional array, you enclose each row’s initialization list in___________.a. bracesb. parenthesesc. bracketsd. quotation marks

a

To insert an item at a specific location in an ArrayList object, you use this method.a. storeb. insertc. addd. get

c

To delete an item from an ArrayList object, you use this method.a. removeb. deletec. erased. get

a

To determine the number of items stored in an ArrayList object, you use this method.a. sizeb. capacityc. itemsd. length

a

True or False: Java does not allow a statement to use a subscript that is outside therange of valid subscripts for an array

True

True or False: An array’s sitze declarator can be a negative integer expression.

False

True or False: Both of the following declarations are legal and equivalent:int[] numbers;int numbers[];

True

True or False: The subscript of the last element in a single-dimensional array is oneless than the total number of elements in the array.

True

True or False: The values in an initialization list are stored in the array in the orderthat they appear in the list.

True

True or False: The Java compiler does not display an error message when it processesa statement that uses an invalid subscript.

True

True or False: When an array is passed to a method, the method has access to theoriginal array

True

True or False: The first size declarator in the declaration of a two-dimensional arrayrepresents the number of columns. The second size declarator represents the numberof rows.

False

True or False: A two-dimensional array has multiple length fields.

True

True or False: An ArrayList automatically expands in size to accommodate the itemsstored in it.

True

int[] collection = new int[-20];

The size declarator cannot be negative.

. int[] hours = 8, 12, 16;

The initialization list must be enclosed in braces.

int[] table = new int[10];for (int x = 1; x <= 10; x++){ table[x] = 99;}

The loop uses the values 1 through 10 as subscripts. Itshould use 0 through 9.

String[] names = { "George", "Susan" };int totalLength = 0;for (int i = 0; i < names.length(); i++) totalLength += names[i].length;

With an array, length is a field. With a String, lengthis a method. This code uses lengthas if it were a method in the array, and a field in the String.

String[] words = { "Hello", "Goodbye" };System.out.println(words.toUpperCase());

A subscript should be used with words, such as words[0].toUpperCase().