Exam 8: Arrays and the Arraylist Class

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

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

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

A

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[]?

Free
(Multiple Choice)
4.8/5
(41)
Correct Answer:
Verified

C

What will be the value of x[8] after the following code has been 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; }

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

C

The purpose of the sequential search algorithm is to rearrange the elements of an array so they appear in order from the lowest value to the highest value.

(True/False)
4.7/5
(28)

What will be the results 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)
5.0/5
(39)

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

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.8/5
(39)

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

(True/False)
4.8/5
(32)

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

(True/False)
4.9/5
(40)

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

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

(Multiple Choice)
4.7/5
(44)

Given that String[] str has been initialized,to get a copy of str[0] with all characters converted to upper case,use the following statement:

(Multiple Choice)
4.7/5
(36)

When an individual element of an array is passed to a method

(Multiple Choice)
4.8/5
(41)

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

(True/False)
4.8/5
(32)

In memory,an array of String objects

(Multiple Choice)
4.8/5
(41)

This ArrayList class method deletes an item from an ArrayList.

(Multiple Choice)
4.7/5
(39)

What will be the value of x[1] after the following code is executed? int[] x = {22,33,44}; ArrayProcess(x[1]); ).. Public static void arrayProcess(int a) { A = a + 5; }

(Multiple Choice)
4.8/5
(42)

A search algorithm...

(Multiple Choice)
4.9/5
(36)

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

(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.8/5
(32)
Showing 1 - 20 of 52
close modal

Filters

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