Exam 7: Arrays and Array Lists

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

Suppose you wish to process an array of values and eliminate any potential duplicate values stored in the array.Which array algorithms might be adapted for this?

(Multiple Choice)
4.9/5
(32)

Consider the following code snippet: String[] data = { "abc", "def", "ghi", "jkl" }; Using Java 6 or later, which statement grows the data array to twice its size?

(Multiple Choice)
4.8/5
(28)

What is the valid range of index values for an array of size 10?

(Multiple Choice)
4.8/5
(38)

Consider the following code snippet: Consider the following code snippet:   What value is stored in the element of the array list at index 0? What value is stored in the element of the array list at index 0?

(Multiple Choice)
4.9/5
(34)

Assume the method createSomething has been defined as follows: Assume the method createSomething has been defined as follows:

(Multiple Choice)
4.9/5
(41)

What is the output of the following statements? What is the output of the following statements?

(Multiple Choice)
4.9/5
(36)

What is the output of the given code snippet? What is the output of the given code snippet?

(Multiple Choice)
4.7/5
(37)

Consider the following code snippet.Which statement should be used to fill in the empty line so that the output will be [32, 54, 67.5, 29, 35]? Consider the following code snippet.Which statement should be used to fill in the empty line so that the output will be [32, 54, 67.5, 29, 35]?

(Multiple Choice)
4.9/5
(38)

What should you check for when calculating the largest value in an array list?

(Multiple Choice)
4.8/5
(42)

The code snippet below is intended to perform a linear search on the array values to find the location of the value 42.What is the error in the code snippet? The code snippet below is intended to perform a linear search on the array values to find the location of the value 42.What is the error in the code snippet?

(Multiple Choice)
4.9/5
(32)

Which statement(s) about the size of a Java array, array list, and string are true? I.The syntax for determining the size of an array, an array list, and a string in Java is consistent among the three. II.The string uses s.size(), while the array list uses a.length(). III.The array uses a.length, which is not a method call.

(Multiple Choice)
4.7/5
(37)

Assume the variable numbers has been declared to be an array that has at least one element.Which is the following represents the last element in numbers?

(Multiple Choice)
4.8/5
(36)

Assume the method doSomething has been defined as follows: Assume the method doSomething has been defined as follows:   What does the method do? What does the method do?

(Multiple Choice)
4.9/5
(28)

What is the result of executing this code snippet? What is the result of executing this code snippet?

(Multiple Choice)
4.8/5
(35)

Consider the following code snippet in Java 6 or later: Consider the following code snippet in Java 6 or later:   What does the last element of data2 contain? What does the last element of data2 contain?

(Multiple Choice)
4.8/5
(42)

What is displayed after executing the given code snippet? What is displayed after executing the given code snippet?

(Multiple Choice)
4.8/5
(30)

Consider the following code snippet: Consider the following code snippet:   Identify the appropriate statement to display the value 24 from the given array? Identify the appropriate statement to display the value 24 from the given array?

(Multiple Choice)
4.9/5
(39)

Assume the method doSomething has been defined as follows: Assume the method doSomething has been defined as follows:   What does the method do? What does the method do?

(Multiple Choice)
4.9/5
(37)

Consider the following code snippet: Consider the following code snippet:   What is the output of the given code snippet on execution? What is the output of the given code snippet on execution?

(Multiple Choice)
4.8/5
(36)

The following statement gets an element from position 4 in an array: x = a[4]; What is the equivalent operation using an array list?

(Multiple Choice)
4.8/5
(33)
Showing 41 - 60 of 117
close modal

Filters

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