Exam 15: The Java Collections Framework

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

We might choose to use a linked list over an array list when we will not require frequent ____. I random access II inserting new elements III removing of elements

(Multiple Choice)
4.8/5
(39)

Complete the following code, which is intended to print out all key/value pairs in a map named myMap that contains String data for student IDs and names: Map<String, String> myMap = new HashMap<String, String>(); ) . . _______________________________ For (String aKey : mapKeySet) { String name = myMap.get(aKey); System.out.println("ID: " + aKey + "->" + name); }

(Multiple Choice)
4.9/5
(31)

A collection that allows items to be added only at one end and removed only at the other end is called a ____.

(Multiple Choice)
4.9/5
(24)

Assume that you have declared a stack named myStack to hold String elements. Which of the following statements will correctly remove an element from myStack?

(Multiple Choice)
4.8/5
(29)

You need to write a program to build and maintain a catalog of college courses that are associated with specific majors. Which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.8/5
(32)

A collection that remembers the order of items, and allows items to be added and removed only at one end is called a ____.

(Multiple Choice)
4.8/5
(31)

Which data structure would best be used for storing a set of numbers and sorting them in ascending order?

(Multiple Choice)
4.9/5
(33)

Suppose you push integer elements 1,2,3,4 onto a stack in that order. Then pop an element off the stack and add that element to a queue. You repeat that process three more times. In what order will you remove the elements from the queue?

(Multiple Choice)
5.0/5
(33)

Assume that you have declared a map named myMap to hold String elements with Integer keys. Which of the following statements will correctly remove an element from myMap?

(Multiple Choice)
4.9/5
(27)

You want to enumerate all of the keys in a map named myMap whose keys are type String. Which of the following statements will allow you to do this?

(Multiple Choice)
4.8/5
(33)
Showing 101 - 110 of 110
close modal

Filters

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