Exam 7: Arrays and the Arraylist Class

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

Subscripting always starts with __________.

(Multiple Choice)
4.9/5
(38)

The ArrayList class is in the __________ package.

(Multiple Choice)
4.8/5
(40)

Given that String[ ] str has been initialized, to get a copy of str[0] with all the characters converted to uppercase, you would use the __________ statement.

(Multiple Choice)
4.9/5
(31)

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

(Multiple Choice)
4.7/5
(35)

In Java, you do not use the new operator when you use a(n) ____________.

(Multiple Choice)
4.9/5
(38)

By default, Java initializes array elements to __________.

(Multiple Choice)
4.8/5
(36)

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

(Multiple Choice)
4.7/5
(31)

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

(True/False)
4.7/5
(36)

In memory, an array of String objects __________.

(Multiple Choice)
4.8/5
(39)

The binary search algorithm __________.

(Multiple Choice)
4.8/5
(37)

If a[ ] and b[ ] are two integer arrays, the expression a == b compares the array contents.

(True/False)
4.8/5
(33)

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

(Multiple Choice)
5.0/5
(41)

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.8/5
(41)

Which of the following for loops is valid, given the following declaration? String[ ] names = {"abc", "def", "ghi", "jkl"};

(Multiple Choice)
4.8/5
(41)

Which of the following ArrayList class methods is used to insert an item at a specific location in an ArrayList?

(Multiple Choice)
4.9/5
(35)

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.7/5
(35)

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

(Multiple Choice)
4.9/5
(36)

In order to do a binary search on an array __________.

(Multiple Choice)
4.8/5
(37)

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

(True/False)
4.8/5
(31)

What would be the result after the following code is executed? int[ ] x = {23, 55, 83, 19}; Int[ ] y = {36, 78, 12, 24}; X = y; Y = x;

(Multiple Choice)
4.8/5
(38)
Showing 41 - 60 of 63
close modal

Filters

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