Exam 9: Advanced Array Concepts

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

What are some of the advantages of creating an enumeration type?

(Essay)
4.9/5
(37)

int[][] myVals = {{10, 15, 20, 25},                   {30, 35, 40, 45, 50, 55, 60},                   {65, 70, 75, 80, 85, 90}}; Using the above array, what is the value of myVals.length ? What is the value of myVals[1].length ? What is the value of myVals[2].length ? Explain how you determined these values.

(Essay)
4.7/5
(47)

When you place objects in order beginning with the object that has the highest value, you are sorting in ____ order.

(Multiple Choice)
4.9/5
(32)

____ is the process of arranging a series of objects in some logical order.

(Multiple Choice)
4.9/5
(43)
Match each term with the correct statement below.
Premises:
Use them with the class name without instantiating an object
Responses:
set() method
jagged array
Enumerated data type
Correct Answer:
Verified
Premises:
Responses:
Use them with the class name without instantiating an object
set() method
(Matching)
4.9/5
(33)

What is the advantage of declaring an ArrayList with a specified type?

(Essay)
4.9/5
(32)

Regarding enumerations, the ____ method returns an integer that represents the constant's position in the list of constants; as with arrays, the first position is 0.

(Multiple Choice)
4.8/5
(37)

Regarding enumerations, the ____ method returns the name of the calling constant object.

(Multiple Choice)
4.9/5
(40)

The ArrayList class ____ method removes an item from an ArrayList at a specified location.

(Multiple Choice)
4.9/5
(26)

import javax.swing.*; class FindPoints {    public static void main(String[] args)    {       int[][] points =      {{10, 20, 30},       {20, 40, 60},       {40, 60, 80}};       String prompt;       int class;       int level;       prompt = JOptionPane.showInputDialog(null, "Class: ");       class = Integer.parseInt(prompt);       prompt = JOptionPane.showInputDialog(null, "Level: ");       level = Integer.parseInt(prompt);       JOption.showMessageDialog(null, "Your points: " + ---complete code here-----);    } } The above code depicts a two-dimensional array named points that refers to a Class and Level to determine a point value. Complete the JOption command so that the code will determine a point value based on the points array.

(Essay)
4.8/5
(30)
Match each term with the correct statement below.
Premises:
A popularly known sorting method
Responses:
ascending order
matrix
static methods
Correct Answer:
Verified
Premises:
Responses:
A popularly known sorting method
ascending order
(Matching)
4.8/5
(43)

Write the statement to declare an ArrayList named myVals with a capacity of 15 items. Explain the importance of capacity when working with an ArrayList .

(Essay)
4.8/5
(30)

The bubble sort is the fastest and most efficient sorting technique.

(True/False)
4.8/5
(44)

In a(n) ____, you repeatedly compare pairs of items, swapping them if they are out of order, eventually creating a sorted list.

(Multiple Choice)
4.9/5
(40)
Match each term with the correct statement below.
Premises:
Can be pictured as a column of values
Responses:
type-safe
Enumerated data type
one-dimensional array
Correct Answer:
Verified
Premises:
Responses:
Can be pictured as a column of values
type-safe
(Matching)
4.9/5
(32)

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.9/5
(32)

Which Java statement creates a jagged array with six rows?

(Multiple Choice)
4.8/5
(38)
Match each term with the correct statement below.
Premises:
Placing objects in order beginning with the lowest value
Responses:
multidimensional array
set() method
ascending order
Correct Answer:
Verified
Premises:
Responses:
Placing objects in order beginning with the lowest value
multidimensional array
(Matching)
4.9/5
(33)

How can you sort arrays of objects?

(Essay)
4.8/5
(45)

The ArrayList class ____ method retrieves an item from a specified location in an ArrayList .

(Multiple Choice)
4.9/5
(38)
Showing 21 - 40 of 80
close modal

Filters

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