Exam 7: Arrays and Array Lists

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

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.length? Which is the value of data.length?

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

B

Which one of the following statements is a valid initialization of an array named somearray of ten elements?

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

A

Consider the following code snippet: int val = arr[0][2]; Which value of arr is stored in the val variable?

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

C

Which statements about array algorithms are true? I.The array algorithms are building blocks for many programs that process arrays. II.Java contains ready-made array algorithms for every problem situation. III.It is inefficient to make multiple passes through an array if you can do everything in one pass.

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.8/5
(44)

When an integer literal is added to an array list declared as ArrayList<Integer>, Java performs:

(Multiple Choice)
4.7/5
(32)

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

(Multiple Choice)
4.9/5
(25)

What is the value of the count variable after the execution of the given code snippet? What is the value of the count variable after the execution of the given code snippet?

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

Which one of the following statements is correct for displaying the value in the second row and the third column of a two-dimensional, size 3 by 4 array?

(Multiple Choice)
4.7/5
(34)

Consider the following code snippet: Consider the following code snippet:   Which one of the following is true about the check method in the given code snippet? Which one of the following is true about the check method in the given code snippet?

(Multiple Choice)
4.9/5
(39)

Consider using a deck of cards as a way to visualize a shuffle algorithm.When two cards shuffle their position, what has to happen to the size of the array holding them?

(Multiple Choice)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(30)

Which statements about the enhanced for loop are true for arrays of primitive data? I.It is suitable for all array algorithms. II.It does not allow the contents of the array to be modified. III.It does not require the use of an index variable.

(Multiple Choice)
4.8/5
(34)

Which one of the following is a correct declaration for a method named passAList with the array list num of size 5 as a parameter?

(Multiple Choice)
4.7/5
(29)

Which statements are true regarding the differences between arrays and array lists? I. Arrays are better if the size of a collection will not change. II. Array lists are more efficient than arrays. III. Array lists are easier to use than arrays.

(Multiple Choice)
4.9/5
(36)

How many elements can be stored in an array of dimension 2 by 3?

(Multiple Choice)
4.9/5
(46)

It may be necessary to "grow" an array when reading inputs because

(Multiple Choice)
5.0/5
(34)

Consider the following code snippet: Consider the following code snippet:   What is the output of the given code snippet if the user enters 1,2,0,0,1 as the input? What is the output of the given code snippet if the user enters 1,2,0,0,1 as the input?

(Multiple Choice)
4.8/5
(34)

Regression testing is:

(Multiple Choice)
4.9/5
(45)
Showing 1 - 20 of 117
close modal

Filters

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