Exam 7: Arrays and the ArrayList Class

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

A(n) ________ is used as an index to pinpoint a specific element within an array.

(Multiple Choice)
4.9/5
(42)

When an array of objects is declared, but not initialized, the array values are set to 0.

(True/False)
4.9/5
(29)

What is a ragged array?

(Multiple Choice)
4.9/5
(37)

The binary search algorithm

(Multiple Choice)
4.9/5
(41)

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

(Multiple Choice)
4.9/5
(39)

For the following code, what would be the value of str[2]? String[] str = {"abc", "def", "ghi", "jkl"};

(Multiple Choice)
4.8/5
(37)

What will be the result of the following code? 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)
4.8/5
(40)

An array of String objects

(Multiple Choice)
4.9/5
(43)

A partially filled array is normally used

(Multiple Choice)
4.9/5
(37)

Java provides a mechanism known as ________, which makes it possible to write a method that takes a variable number of arguments.

(Multiple Choice)
4.8/5
(29)

The String[] args parameter in the main method header allows the program to receive arguments from the operating system command line.

(True/False)
4.7/5
(34)

You use this method to determine the number of items stored in an ArrayList object.

(Multiple Choice)
4.8/5
(40)

To return an array of long values from a method, use this as the return type for the method.

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(42)

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

(True/False)
4.9/5
(38)

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

(Multiple Choice)
4.9/5
(35)

Which of the statements are true about the following code? Final int ARRAY_SIZE = 10; Long[] array1 = new long[ARRAY_SIZE];

(Multiple Choice)
4.9/5
(41)

This method returns a string representing all of the items stored in an ArrayList object.

(Multiple Choice)
4.9/5
(33)

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

(True/False)
4.7/5
(31)
Showing 21 - 40 of 40
close modal

Filters

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