Exam 8: Arrays

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

When a method returns an array reference, you include ____ with the return type in the method header.

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

D

Write the statement to create an array named studentScores that will store five integer value student scores. Initialize the array using an initialization list with the values 70, 85, 92, 67, and 76.

Free
(Short Answer)
4.7/5
(85)
Correct Answer:
Verified

int[] studentScores = {70, 85, 92, 67, 76};

public static int[] sampleArray() {     int studentScores = {72, 91, 83};     ____ } Using the above code, write the statement that will return the array name.

Free
(Short Answer)
4.8/5
(79)
Correct Answer:
Verified

return studentScores;

An instance variable or object field is also called a(n) ____________________ of the object.

(Short Answer)
4.8/5
(90)

Write the statement to declare an array of integers that will hold studentScores .

(Short Answer)
4.9/5
(71)

What is a subscript and how are the array's elements numbered?

(Essay)
4.8/5
(87)

Languages such as Visual Basic, BASIC, and COBOL use ____ to refer to individual array elements.

(Multiple Choice)
4.8/5
(86)

Which of the following statements correctly declares and creates an array to hold five double scores values?

(Multiple Choice)
4.9/5
(75)

Comparing a variable to a list of values in an array is a process called ____ an array.

(Multiple Choice)
4.9/5
(92)

When you initialize parallel arrays, it is convenient to use ____ so that the values that correspond to each other visually align on the screen or printed page.

(Multiple Choice)
4.8/5
(84)

Which of the following statements correctly initializes an array with an initialization list?

(Multiple Choice)
4.8/5
(75)

What does an array's name represent and what value does it hold when declared?

(Essay)
4.8/5
(82)

To initialize an array, you use an initialization list of values separated by commas and enclosed within curly braces.

(True/False)
4.9/5
(91)

A(n) ____________________ is a named list of data items that all have the same type.

(Short Answer)
4.9/5
(89)

In which of the following statements is the value of myVals null ?

(Multiple Choice)
4.7/5
(85)

When you declare or access an array, you can use any expression to represent the size, as long as the expression is a(n) ____________________.

(Short Answer)
5.0/5
(87)

String[] countyNames = {"Clark", "Delaware", "Madison"}; What will be the value of countyNames[0].length() , countyNames[1].length() , and countyNames[2].length() ?

(Essay)
4.9/5
(74)

Since an array name is a reference, you are able to use the = operator for assigning and the == operator for comparisons.

(True/False)
4.8/5
(80)

When any primitive type variable is passed to a method, the _____ is passed.

(Multiple Choice)
4.9/5
(87)

When array elements are passed by value, a copy of the value is made and used within the receiving method.

(True/False)
4.9/5
(81)
Showing 1 - 20 of 66
close modal

Filters

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