Exam 7: Arrays and Arraylists

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

An argument type followed by a(n) in a method's parameter list indicates that the method receives a variable number of arguments of that particular type.

Free
(Multiple Choice)
4.7/5
(33)
Correct Answer:
Verified

B

Which of the following statements creates a multidimensional array with 3 rows, where the first row contains 1 element, the second row contains 4 elements and the final row contains 2 elements?

Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
Verified

B

Which of the following statements is true?

Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
Verified

C

Which of the following will not produce a compiler error?

(Multiple Choice)
4.9/5
(29)

The preferred way to traverse a two-dimensional array is to use .

(Multiple Choice)
4.7/5
(37)

Which set of statements totals the items in each row of two-dimensional array items, and displays each row's total?

(Multiple Choice)
4.8/5
(40)

An exception object's ________ method returns the exception's error message.

(Multiple Choice)
4.8/5
(37)

Consider the array: s[0] = 7 S[1] = 0 S[2] = -12 S[3] = 9 S[4] = 10 S[5] = 3 S[6] = 6 The value of s[s[6] - s[5]] is:

(Multiple Choice)
4.8/5
(38)

Attempting to access an array element outside of the bounds of an array, causes a(n) .

(Multiple Choice)
4.9/5
(34)

In array items, which expression below accesses the value at row 3 and column 4?

(Multiple Choice)
4.8/5
(35)

Class Arrays provides method __________ for comparing arrays to determine whether they have the same contents.

(Multiple Choice)
4.9/5
(33)

What do the following statements do? double[] array; Array = new double[14];

(Multiple Choice)
4.9/5
(33)

Constant variables also are called .

(Multiple Choice)
4.8/5
(33)

Which of the following statements is false?

(Multiple Choice)
5.0/5
(34)

Which expression adds 1 to the element of array arrayName at index i?

(Multiple Choice)
4.7/5
(38)

An array with m rows and n columns is not ________. A. an m-by-n array. B. an n-by-m array. C. a two-dimensional array. D. a dual-transcripted array.

(Multiple Choice)
4.8/5
(41)

Consider array items, which contains the values 0, 2, 4, 6 and 8. If method changeArray is called with the method call changeArray(items, items[2]), what values are stored in items after the method has finished executing? public static void changeArray(int[] passedArray, int value) { PassedArray[value] = 12; Value = 5; }

(Multiple Choice)
4.9/5
(38)

Assume array items contains the integer values 0, 2, 4, 6 and 8. Which of the following uses the enhanced for loop to display each value in array items?

(Multiple Choice)
4.9/5
(38)

For tthe array that was the correct answer in the previous question, what is the value returned by items[1][0]?

(Multiple Choice)
4.9/5
(38)

Class ________ represents a dynamically resizable array-like data structure.

(Multiple Choice)
4.9/5
(30)
Showing 1 - 20 of 46
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)