Exam 9: Advanced Array Concepts

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

What import statements must be used before you can use an ArrayList class?

(Essay)
5.0/5
(45)

import java.util.*; public class myArray {     public static void main(String[] args)     {       int myVals = new int[4];       -----Code here-----       display("My values are: ", myVals);     }     public static void display(String message, int array[])     {        int arraySize = array.length;        System.out.print(message);        for(int x = 0; x           System.out.print(array[x] + " ");     } } Using the above code, complete the indicated section with a fill method() to fill each array element with a value of 2. What will be displayed after the display() method is executed?

(Essay)
4.8/5
(43)

An array that you can picture as a column of values, and whose elements you can access using one subscript, is a ____ array.

(Multiple Choice)
4.8/5
(34)

When using the Arrays.binarySearch() method, it is not necessary for the list to be in order because the binarySearch() method will sort the items when called.

(True/False)
4.7/5
(40)

When you pass a two-dimensional array to a method, you pass the array name just as you do with a one-dimensional array.

(True/False)
4.9/5
(39)

Using the ArrayList add() method, write the statement to insert "July" in the first position of the months ArrayList . Describe what would happen if the position number is invalid for the ArrayList .

(Essay)
4.9/5
(31)
Showing 61 - 66 of 66
close modal

Filters

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