Exam 9: Arrays

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

Which method would you most likely use to find the location of an element in the vector?

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

C

Given the following method heading public static void mystery(int list[], int size)and the declarationint[] alpha = new int[75];Which of the following is a valid call to the method mystery?

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

C

The base address of an array is the memory location of the first array component.

Free
(True/False)
4.9/5
(33)
Correct Answer:
Verified

True

You can create an array of reference variables to manipulate objects.

(True/False)
4.9/5
(45)

double[] as = new double[7]; Double[] bs;bs = as;How many objects are present after the code fragment in the accompanying figure is executed?

(Multiple Choice)
4.8/5
(40)

In which package is the class Vector located?

(Multiple Choice)
4.9/5
(31)

A Vector object can shrink during program execution.

(True/False)
4.8/5
(43)

Which method of the class vector would you use to remove an element at a specific location?

(Multiple Choice)
4.8/5
(43)

Given the method heading public static void strange(int a, int b)and the declarationint[] alpha = new int[20]; Int[] beta = new int[25];Which of the following is a valid call to the method strange?

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(37)

The statementint[] list = new int[15];creates list to be an array of 14 components because array index starts at 0.

(True/False)
4.8/5
(39)

Which of the following is the array subscripting operator in Java?

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
4.9/5
(30)

When a boolean array object is instantiated, its components are initialized to false.

(True/False)
4.9/5
(31)

Arrays have a fixed number of elements.

(True/False)
4.9/5
(43)

What does the following statement do? Vector thisVector = new Vector();

(Multiple Choice)
4.7/5
(41)

Java stores two-dimensional arrays in a row order form in computer memory.

(True/False)
4.7/5
(43)

In a method call statement, when passing an array as an actual parameter, you use only its name.

(True/False)
4.9/5
(35)

Given the declarationdouble[] numList = new double[20];the statementnumList[12] = numList[5] + numList[7];updates the content of the thirteenth component of the array numList.

(True/False)
4.9/5
(39)

Consider the following method definition.public static int strange(int[] list, int listSize, int item) { Int count = 0; For (int j = 0; j < listSize; j++) (list[j]; == item) Count++; Return count; } Which of the following statements best describe the behavior of this method?

(Multiple Choice)
4.7/5
(43)
Showing 1 - 20 of 46
close modal

Filters

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