Exam 9: Arrays

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

In row processing, a two-dimensional array is processed one row at a time.

(True/False)
4.8/5
(38)

When an array object is instantiated, its components are initialized to their default values.

(True/False)
4.8/5
(35)

Which of the following declares an array of int named beta?

(Multiple Choice)
5.0/5
(37)

char[][] table = new char[10][5];How many columns are in the array seen in the accompanying figure?

(Multiple Choice)
4.9/5
(37)

Which limitation of arrays does a vector overcome?

(Multiple Choice)
4.9/5
(36)

int[] numList = new int[50];for (int i = 0; i <50; i++) NumList[i] = 2 * i; Num[10] = -20; Num[30] = 8; How many components are in the array numList seen in the accompanying figure?

(Multiple Choice)
4.7/5
(31)

Only one-dimensional arrays can be passed as parameters.

(True/False)
4.8/5
(34)

The array index can be any nonnegative integer less than the array size.

(True/False)
4.8/5
(36)

Suppose that you have the following declaration.int[] alpha = new int[50]; int[][] beta = new int[10][5];In this declaration, the array alpha has more components than the array beta.

(True/False)
4.8/5
(31)

char[][] table = new char[10][5];How many dimensions are in the array seen in the accompanying figure?

(Multiple Choice)
4.8/5
(38)

Suppose you have the following declaration.double[] salesData = new double[500];Which of the following range is valid for the index of the array salesData. (i) 0 through 500 (ii) 0 through 499

(Multiple Choice)
4.8/5
(38)

Only a fixed number of elements can be stored in a vector.

(True/False)
4.9/5
(38)

char[][] table = new char[10][5];What is the value of table.length?

(Multiple Choice)
4.7/5
(33)

Given the declaration int[] list = new int[50];the statementSystem.out.println(list[0] + "..." + list[49]);outputs all 50 components of the array list.

(True/False)
4.8/5
(35)

The method size in the class Vector returns the number of elements in the vector.

(True/False)
4.8/5
(38)

The following statement creates alpha to be a two-dimensional array of 35 components. int[][] alpha = new int[20][15];

(True/False)
4.9/5
(34)

int[] list = {1, 3, 5, 7};(int i = 0; i < list.length; i++) If (list[i] > 5) System.out.println(i + " " + list[i]);Which indices are in bounds for the array list, given the declaration in the accompanying figure?

(Multiple Choice)
4.7/5
(35)

A single array can hold components of many different data types.

(True/False)
4.8/5
(33)

If an array index is less than or equal to zero, an InvalidIndexException exception is thrown.

(True/False)
4.8/5
(32)

Vectors can be used to implement lists.

(True/False)
4.7/5
(45)
Showing 21 - 40 of 46
close modal

Filters

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