Exam 15: The Java Collections Framework

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

Which of the following statements about hash tables is NOT correct?

(Multiple Choice)
4.8/5
(23)

Select an appropriate expression to complete the following code segment, which is designed to print a message if the string stored in name is part of the players collection. Select an appropriate expression to complete the following code segment, which is designed to print a message if the string stored in name is part of the players collection.

(Multiple Choice)
4.8/5
(43)

You need to access values using a key, and the keys must be sorted.Which collection type should you use?

(Multiple Choice)
4.9/5
(37)

Which of the following statements about stacks is correct?

(Multiple Choice)
4.9/5
(50)

Consider the code snippet shown below.Assume that employeeNames is an instance of type LinkedList<String>. Consider the code snippet shown below.Assume that employeeNames is an instance of type LinkedList<String>.   Which element(s) of employeeNames does this loop process? Which element(s) of employeeNames does this loop process?

(Multiple Choice)
4.8/5
(43)

Using the merge method of the Map interface, which statement correctly updates the wordCount map of type Map<String,Integer> to count all of the occurrences of a word in a file?

(Multiple Choice)
4.9/5
(35)

Assume that you have declared a queue named myQueue to hold String elements.Which of the following statements will correctly delete an element from myQueue?

(Multiple Choice)
4.8/5
(41)

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)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(40)

A list is a collection that ____.

(Multiple Choice)
4.8/5
(31)

Which of the following statements about a priority queue structure is correct?

(Multiple Choice)
4.9/5
(35)

You need to write a program to simulate the effect of adding an additional cashier in a supermarket to reduce the length of time customers must wait to check out.Which data structure would be most appropriate to simulate the waiting customers?

(Multiple Choice)
4.7/5
(41)

A collection without an intrinsic order is called a ____.

(Multiple Choice)
4.8/5
(39)

Which of the following statements about manipulating objects in a map is NOT correct?

(Multiple Choice)
5.0/5
(39)

Assuming that names is a Queue of String objects, select a statement to complete the code segment below.The code is designed to remove the last element from the queue, which is guaranteed to have at least one element. Assuming that names is a Queue of String objects, select a statement to complete the code segment below.The code is designed to remove the last element from the queue, which is guaranteed to have at least one element.

(Multiple Choice)
4.8/5
(35)

Assume that you have declared a set named mySet to hold String elements.Which of the following statements will correctly delete an element from mySet?

(Multiple Choice)
4.9/5
(46)

An Undo feature in a word processor program that allows you to reverse a previously completed command is probably implemented using which structure type?

(Multiple Choice)
4.9/5
(42)

Which of the following statements about linked lists is correct?

(Multiple Choice)
4.9/5
(29)

A stack is a collection that ____.

(Multiple Choice)
4.8/5
(47)

You need to access values in objects by a key that is not part of the object.Which collection type should you use?

(Multiple Choice)
4.9/5
(31)
Showing 21 - 40 of 102
close modal

Filters

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