Exam 7: Arrays and Array Lists

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

Consider the following code snippet: String[] data = { "123", "ghi", "jkl", "def", "%&*" }; Which statement sorts the data array in ascending order?

(Multiple Choice)
4.8/5
(37)

Assume the following variable has been declared and given a value as shown: int[] numbers = {9, 17, -4, 21 }; Which is the value of numbers.length?

(Multiple Choice)
4.9/5
(38)

Which statement is true about the code snippet below? Which statement is true about the code snippet below?

(Multiple Choice)
4.8/5
(32)

What will be printed by the statements below? What will be printed by the statements below?

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.7/5
(40)

Which one of the following statements is true about using arrays with methods?

(Multiple Choice)
4.8/5
(41)

Suppose you wish to use an array to solve a new problem.What is the first step to take in finding a solution?

(Multiple Choice)
4.9/5
(41)

Consider the following line of code: int[] somearray = new int[30]; Which one of the following options is a valid line of code for displaying the twenty-eighth element of somearray?

(Multiple Choice)
5.0/5
(41)

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

(Multiple Choice)
4.9/5
(39)

Which statement correctly describes the enhanced for loop?

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.8/5
(38)

Which one of the following is the correct code snippet for calculating the largest value in an integer array list arrList of size 10?

(Multiple Choice)
4.8/5
(32)

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

Assume the method doSomething has been defined as follows: Assume the method doSomething has been defined as follows:   What is printed by the statements below? int [] nums = {3, 18, 29, -2} ; System.out.print(Arrays.toString(doSomething(nums))); What is printed by the statements below? int [] nums = {3, 18, 29, -2} ; System.out.print(Arrays.toString(doSomething(nums)));

(Multiple Choice)
4.8/5
(36)

Assume the following variable has been declared and given a value as shown: Assume the following variable has been declared and given a value as shown:   Which is the value of data[0].length? Which is the value of data[0].length?

(Multiple Choice)
4.8/5
(36)

Which one of the following statements is the correct declaration for a two-dimensional array of 20 rows and 2 columns of type int?

(Multiple Choice)
4.8/5
(39)

The binary search is more efficient than the linear search, providing

(Multiple Choice)
4.8/5
(35)

Assume the array of integers values has been created.Which condition must be used in the indicated area so the loop below will assign max the largest value in values? Assume the array of integers values has been created.Which condition must be used in the indicated area so the loop below will assign max the largest value in values?

(Multiple Choice)
5.0/5
(33)

Identify the correct statement for defining an integer array named numarray of ten elements.

(Multiple Choice)
4.8/5
(39)

Consider the following code snippet: Consider the following code snippet:   Which statement is true after the main method is executed? Which statement is true after the main method is executed?

(Multiple Choice)
4.8/5
(39)
Showing 21 - 40 of 117
close modal

Filters

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