Exam 8: Arrays

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

While you can provide any legal identifier you want for an array, conventional rules are typically followed. List and describe the naming conventions for naming arrays.

(Essay)
4.8/5
(70)

A(n) ____ loop allows you to cycle through an array without specifying the starting and ending points for the loop control variable.

(Multiple Choice)
4.9/5
(75)
Match each term with the correct statement below.
Premises:
An integer that specifies an array element
Responses:
return
parallel arrays
Java object names
Correct Answer:
Verified
Premises:
Responses:
An integer that specifies an array element
return
(Matching)
4.7/5
(92)

Which of the following println statements will display the last myScores element in an array of 10?

(Multiple Choice)
4.8/5
(83)
Match each term with the correct statement below.
Premises:
A copy of the value is made and used within the receiving method
Responses:
length
passed by value
enhanced for loop
Correct Answer:
Verified
Premises:
Responses:
A copy of the value is made and used within the receiving method
length
(Matching)
4.8/5
(78)

When returning an array reference, square brackets are included with the return type in the method header.

(True/False)
4.9/5
(96)
Match each term with the correct statement below.
Premises:
Numbered beginning with 0
Responses:
foreach loop
elements
enhanced for loop
Correct Answer:
Verified
Premises:
Responses:
Numbered beginning with 0
foreach loop
(Matching)
5.0/5
(86)
Match each term with the correct statement below.
Premises:
Comparing a value to the endpoints of numerical ranges to find the category in which the value belongs.
Responses:
enhanced for loop
Java object names
return
Correct Answer:
Verified
Premises:
Responses:
Comparing a value to the endpoints of numerical ranges to find the category in which the value belongs.
enhanced for loop
(Matching)
4.8/5
(83)

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

(Essay)
4.9/5
(84)

Parallel arrays do not necessarily have the same number of elements.

(True/False)
4.7/5
(72)

When you create an array variable, memory space is automatically reserved.

(True/False)
5.0/5
(62)
Match each term with the correct statement below.
Premises:
A nonprimitive object
Responses:
reference types
elements
enhanced for loop
Correct Answer:
Verified
Premises:
Responses:
A nonprimitive object
reference types
(Matching)
4.8/5
(79)

A(n) ____ is a variable that holds a value as an indicator of whether some condition has been met.

(Multiple Choice)
4.8/5
(67)

double[] studentScores = new double[3]; studentScores[0] = 93; studentScores[1] = 77; studentScores[2] = 85; Write a println statement to display the last element of the studentScores array.

(Short Answer)
4.9/5
(86)
Match each term with the correct statement below.
Premises:
An array field
Responses:
enhanced for loop
length
subscript
Correct Answer:
Verified
Premises:
Responses:
An array field
enhanced for loop
(Matching)
4.9/5
(82)

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

(True/False)
4.8/5
(76)

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
(79)

Describe a situation in which storing just one value at a time in memory does not meet your needs.

(Essay)
4.9/5
(80)

When you create an array of objects, each reference is assigned the value ____.

(Multiple Choice)
4.7/5
(83)

If a class has only a default constructor, you must call the constructor using the keyword ____ for each declared array element.

(Multiple Choice)
4.8/5
(84)
Showing 41 - 60 of 77
close modal

Filters

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