Exam 7: Arrays and the Arraylist Class

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

Which of the following is a correct method header for receiving a two-dimensional array as an argument?

(Multiple Choice)
4.9/5
(36)

Given the following two-dimensional array declaration, which statement is true? int[ ][ ] numbers = new int[6][9];

(Multiple Choice)
4.8/5
(38)

An array of String objects

(Multiple Choice)
5.0/5
(43)

What does <String> specify in the following statement? ArrayList<String> nameList = new ArrayList<String>();

(Multiple Choice)
4.9/5
(34)

What would be the result after the following code is executed? int[ ] numbers = {50, 10, 15, 20, 25, 100, 30}; Int value = 0; For (int i = 1; i < numbers.length; i++) Value += numbers[i];

(Multiple Choice)
4.9/5
(30)

If numbers is a two-dimensional array, which of the following would give the number of columns in row r?

(Multiple Choice)
4.8/5
(33)

Which method is used to determine the number of items stored in an ArrayList object?

(Multiple Choice)
4.8/5
(37)

What is the value of scores[2][3] in the following array? int[ ][ ] scores = { {88, 80, 79, 92}. {75, 84, 93, 80}, {98, 95, 92, 94}, {91, 84, 88, 96} };

(Multiple Choice)
4.9/5
(33)

A ragged array is

(Multiple Choice)
4.7/5
(30)

You can use the __________ method to replace an item at a specific location in an ArrayList.

(Multiple Choice)
4.9/5
(31)

In order to do a binary search on an array

(Multiple Choice)
4.8/5
(40)

Which of the following statements is(are) true about this code? final int ARRAY_SIZE = 10; Long[] array1 = new long[ARRAY_SIZE];

(Multiple Choice)
5.0/5
(43)

Which of the following methods returns a string representing all of the items stored in an ArrayList object?

(Multiple Choice)
4.9/5
(35)

The sequential search algorithm

(Multiple Choice)
4.8/5
(37)

Which of the following is a valid declaration for a ragged array with five rows but no columns?

(Multiple Choice)
4.7/5
(35)

To return an array of long values from a method, which return type should be used for the method?

(Multiple Choice)
4.9/5
(50)

What would be the result after the following code is executed? int[ ] numbers = {40, 3, 5, 7, 8, 12, 10}; Int value = numbers[0]; For (int i = 1; i < numbers.length; i++) { If (numbers[i] < value) Value = numbers[i]; }

(Multiple Choice)
5.0/5
(35)

Java does not limit the number of dimensions an array may have.

(True/False)
4.9/5
(37)

The Java compiler will display an error message when it processes a statement that uses an invalid subscript.

(True/False)
5.0/5
(25)

A sorting algorithm is used to locate a specific item in a larger collection of data.

(True/False)
4.8/5
(38)
Showing 21 - 40 of 40
close modal

Filters

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