Exam 9: Advanced Array Concepts

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

How can you pass a two-dimensional array to a method?

(Essay)
4.7/5
(41)

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

(Essay)
4.9/5
(31)

import java.util.*; public class sortArray { public static void main(String[] args) { double[] lengths = {120.0, 0.5, 0.0, 999.0, 77.3}; Arrays.sort(lengths); System.out.println(Arrays.toString(lengths)); } } Using the above code, what will be the output of the println statement when the code is executed?

(Essay)
4.7/5
(35)

Match each term with the correct statement below. -A popularly known sorting method

(Multiple Choice)
4.8/5
(41)

If you do not provide values for the elements in a two-dimensional numeric array, the values default to null.

(True/False)
4.9/5
(29)

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

(Multiple Choice)
4.7/5
(37)

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

int[][] myVals = {{2, 4, 6}, {1, 3, 5, 7}}; Using the above array, what is the value of myVals.length?

(Multiple Choice)
4.9/5
(40)

To declare a two-dimensional array in Java, you type two sets of ____ after the array type.

(Multiple Choice)
4.9/5
(36)

int[][] myVals = new int[3][] myVals[0] = new int[3]; myVals[1] = new int[10]; myVals[2] = new int[5]; The above code depicts a ragged array. What does this mean? Describe the rows and columns that make up this array.

(Essay)
4.8/5
(34)

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

(Short Answer)
4.8/5
(35)

You can add an item at any point in a(n) ____ container and the array size expands automatically to accommodate the new item.

(Multiple Choice)
4.9/5
(32)

Dummy values are a common programming technique used with arrays. Explain the importance of dummy values and how they can be used to ensure that the subscript does not exceed the allowable limit.

(Essay)
4.8/5
(32)

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,

(Essay)
4.8/5
(37)
Showing 61 - 74 of 74
close modal

Filters

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