Exam 7: Arrays and the Arraylist Class

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

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

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

C

Once an array is created, its size cannot be changed.

Free
(True/False)
4.9/5
(39)
Correct Answer:
Verified

True

Java performs ____________, which means that it does not allow a statement to use a subscript that is outside the range of valid subscripts for the array.

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

B

It is common practice to use a __________ variable as a size declarator.

(Multiple Choice)
4.8/5
(44)

A ragged array is __________.

(Multiple Choice)
4.8/5
(34)

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

(Multiple Choice)
4.7/5
(35)

What would be the result after the following code is executed? final int SIZE = 25; Int[ ] array1 = new int[SIZE]; ).. // Code that will put values in array1 Int value = 0; For (int a = 0; a <= array1.length; a++) { Value += array1[a]; }

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
5.0/5
(43)

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

(True/False)
4.8/5
(32)

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

(Multiple Choice)
4.9/5
(27)

Any items typed on the command line, separated by a 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.8/5
(39)

Java limits the number of dimensions that an array can have to 15.

(True/False)
4.9/5
(39)

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

(Multiple Choice)
4.8/5
(31)

The ___________ method is used to insert an item into an ArrayList.

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.8/5
(35)

What will be the value of x[8] after the following code is executed? final int SUB = 12; Int[ ] x = new int[SUB]; Int y = 20; For(int i = 0; i < SUB; i++) { X[i] = y; Y += 5; }

(Multiple Choice)
4.9/5
(38)

If final int SIZE = 15 and int[ ] x = new int[SIZE], what would be the range of subscript values that could be used with x[ ]?

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.7/5
(39)

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

(Multiple Choice)
4.9/5
(29)

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

(Multiple Choice)
4.9/5
(36)
Showing 1 - 20 of 63
close modal

Filters

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