Exam 7: Arrays and the ArrayList Class

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

When an array is passed to a method

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

D

What does the following statement do? Double[] array1 = new double[10];

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

D

The following import statement is required to use the ArrayList class:

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

B

What will be the result of executing the following code? Int[] x = {0, 1, 2, 3, 4, 5};

(Multiple Choice)
4.9/5
(38)

Objects in an array are accessed with subscripts, just like any other data type in an array.

(True/False)
4.8/5
(36)

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
(39)

You can use this ArrayList class method to insert an item at a specific location in an ArrayList.

(Multiple Choice)
4.9/5
(36)

A sorting algorithm is a technique for scanning through an array and rearranging its contents in some specific order.

(True/False)
4.8/5
(30)

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

(Multiple Choice)
4.7/5
(42)

In order to do a binary search on an array,

(Multiple Choice)
4.7/5
(34)

To determine if two arrays are equal, you must compare each of the elements of the two arrays.

(True/False)
4.9/5
(44)

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

(Multiple Choice)
4.9/5
(45)

Any items typed on the command-line, separated by space, after the name of the class are considered to be one or more arguments that are to be passed into the main method.

(True/False)
4.7/5
(31)

What will be the result of the following code? Final int ARRAY_SIZE = 5; Float[] x = float[ARRAY_SIZE]; For(int i = 1; i <= ARRAY_SIZE; i++) { X[i] = 10.0; }

(Multiple Choice)
4.7/5
(40)

The sequential search algorithm

(Multiple Choice)
4.8/5
(41)

A search algorithm

(Multiple Choice)
4.8/5
(39)

The ________ method removes an item from an ArrayList at a specific index.

(Multiple Choice)
4.7/5
(37)

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

(True/False)
4.7/5
(35)

An ArrayList object automatically expands in size to accommodate the items stored in it.

(True/False)
4.7/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.8/5
(39)
Showing 1 - 20 of 40
close modal

Filters

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